diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-04-28 23:20:11 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-04-28 23:20:11 +0200 |
commit | 79671ec57e59091260a0bc3d40a31d31d9c72a94 (patch) | |
tree | 2f59a8727b8f63f9e79d50352fa4f78a7cc00234 /spec/ruby/core/regexp/match_spec.rb | |
parent | 994833085ae06afbe94d30ab183d80e0234fbe14 (diff) | |
download | ruby-79671ec57e59091260a0bc3d40a31d31d9c72a94.tar.gz |
Update to ruby/spec@7de852d
Diffstat (limited to 'spec/ruby/core/regexp/match_spec.rb')
-rw-r--r-- | spec/ruby/core/regexp/match_spec.rb | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/spec/ruby/core/regexp/match_spec.rb b/spec/ruby/core/regexp/match_spec.rb index 45ed4a5932..ebbba38211 100644 --- a/spec/ruby/core/regexp/match_spec.rb +++ b/spec/ruby/core/regexp/match_spec.rb @@ -44,15 +44,13 @@ describe "Regexp#match" do /(.).(.)/.match("01234", 1).captures.should == ["1", "3"] end - with_feature :encoding do - it "uses the start as a character offset" do - /(.).(.)/.match("零一二三四", 1).captures.should == ["一", "三"] - end - - it "raises an ArgumentError for an invalid encoding" do - x96 = ([150].pack('C')).force_encoding('utf-8') - lambda { /(.).(.)/.match("Hello, #{x96} world!", 1) }.should raise_error(ArgumentError) - end + it "uses the start as a character offset" do + /(.).(.)/.match("零一二三四", 1).captures.should == ["一", "三"] + end + + it "raises an ArgumentError for an invalid encoding" do + x96 = ([150].pack('C')).force_encoding('utf-8') + lambda { /(.).(.)/.match("Hello, #{x96} world!", 1) }.should raise_error(ArgumentError) end end @@ -61,15 +59,13 @@ describe "Regexp#match" do /(.).(.)/.match("01234", -4).captures.should == ["1", "3"] end - with_feature :encoding do - it "uses the start as a character offset" do - /(.).(.)/.match("零一二三四", -4).captures.should == ["一", "三"] - end + it "uses the start as a character offset" do + /(.).(.)/.match("零一二三四", -4).captures.should == ["一", "三"] + end - it "raises an ArgumentError for an invalid encoding" do - x96 = ([150].pack('C')).force_encoding('utf-8') - lambda { /(.).(.)/.match("Hello, #{x96} world!", -1) }.should raise_error(ArgumentError) - end + it "raises an ArgumentError for an invalid encoding" do + x96 = ([150].pack('C')).force_encoding('utf-8') + lambda { /(.).(.)/.match("Hello, #{x96} world!", -1) }.should raise_error(ArgumentError) end end |