aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/language/match_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-11-30 21:26:52 +0100
committerBenoit Daloze <eregontp@gmail.com>2019-11-30 21:26:52 +0100
commit1243255c3a36433041012b6107a5ac48658a0895 (patch)
tree04440f84b48999ff08d4a2a16d066d0ad731400e /spec/ruby/language/match_spec.rb
parentab8345271eb87ff155d8bd5f22f53a4cf2902c26 (diff)
downloadruby-1243255c3a36433041012b6107a5ac48658a0895.tar.gz
Update to ruby/spec@4eec3dc
Diffstat (limited to 'spec/ruby/language/match_spec.rb')
-rw-r--r--spec/ruby/language/match_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/language/match_spec.rb b/spec/ruby/language/match_spec.rb
index 36d347bd57..ebf677cabc 100644
--- a/spec/ruby/language/match_spec.rb
+++ b/spec/ruby/language/match_spec.rb
@@ -48,6 +48,13 @@ describe "The =~ operator with named captures" do
end
end
+ describe "on syntax of 'string_literal' =~ /regexp/" do
+ it "does not set local variables" do
+ 'string literal' =~ /(?<matched>str)(?<unmatched>lit)?/
+ local_variables.should == []
+ end
+ end
+
describe "on syntax of string_variable =~ /regexp/" do
it "does not set local variables" do
@string =~ /(?<matched>foo)(?<unmatched>bar)?/