summaryrefslogtreecommitdiff
path: root/spec/ruby/command_line
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-10-26 18:00:24 +0900
committerGitHub <noreply@github.com>2020-10-26 18:00:24 +0900
commit52c630da004d9273e8e5fc91c6304e9eed902566 (patch)
tree8414c98aa099355174ca6525757128d560ce5f8a /spec/ruby/command_line
parentcffdacb15a363321e1c1879aa7d94924acafd1cf (diff)
Assoc pattern matching (#3703)
[Feature #17260] One-line pattern matching using tASSOC R-assignment is rejected instead.
Notes
Notes: Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'spec/ruby/command_line')
-rw-r--r--spec/ruby/command_line/dash_upper_w_spec.rb4
-rw-r--r--spec/ruby/command_line/rubyopt_spec.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/command_line/dash_upper_w_spec.rb b/spec/ruby/command_line/dash_upper_w_spec.rb
index 8343bc08e43..2b617f9f7fe 100644
--- a/spec/ruby/command_line/dash_upper_w_spec.rb
+++ b/spec/ruby/command_line/dash_upper_w_spec.rb
@@ -32,10 +32,10 @@ ruby_version_is "2.7" do
describe "The -W command line option with :no-experimental" do
it "suppresses experimental warnings" do
- result = ruby_exe('0 in a', args: '2>&1')
+ result = ruby_exe('case 0; in a; end', args: '2>&1')
result.should =~ /is experimental/
- result = ruby_exe('0 in a', options: '-W:no-experimental', args: '2>&1')
+ result = ruby_exe('case 0; in a; end', options: '-W:no-experimental', args: '2>&1')
result.should == ""
end
end
diff --git a/spec/ruby/command_line/rubyopt_spec.rb b/spec/ruby/command_line/rubyopt_spec.rb
index ee4e594a1c0..a739f23eb8c 100644
--- a/spec/ruby/command_line/rubyopt_spec.rb
+++ b/spec/ruby/command_line/rubyopt_spec.rb
@@ -68,13 +68,13 @@ describe "Processing RUBYOPT" do
it "suppresses experimental warnings for '-W:no-experimental'" do
ENV["RUBYOPT"] = '-W:no-experimental'
- result = ruby_exe('0 in a', args: '2>&1')
+ result = ruby_exe('case 0; in a; end', args: '2>&1')
result.should == ""
end
it "suppresses deprecation and experimental warnings for '-W:no-deprecated -W:no-experimental'" do
ENV["RUBYOPT"] = '-W:no-deprecated -W:no-experimental'
- result = ruby_exe('($; = "") in a', args: '2>&1')
+ result = ruby_exe('case ($; = ""); in a; end', args: '2>&1')
result.should == ""
end
end