1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -35,7 +35,7 @@ describe "Regexp#match" do
end
it "raises a TypeError on an uninitialized Regexp" do
lambda { Regexp.allocate.match('foo') }.should raise_error(TypeError)
-> { Regexp.allocate.match('foo') }.should raise_error(TypeError)
end
describe "with [string, position]" do
@ -50,7 +50,7 @@ describe "Regexp#match" do
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)
-> { /(.).(.)/.match("Hello, #{x96} world!", 1) }.should raise_error(ArgumentError)
end
end
@ -65,7 +65,7 @@ describe "Regexp#match" do
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)
-> { /(.).(.)/.match("Hello, #{x96} world!", -1) }.should raise_error(ArgumentError)
end
end
@ -98,12 +98,12 @@ describe "Regexp#match" do
it "raises TypeError when the given argument cannot be coerced to String" do
f = 1
lambda { /foo/.match(f)[0] }.should raise_error(TypeError)
-> { /foo/.match(f)[0] }.should raise_error(TypeError)
end
it "raises TypeError when the given argument is an Exception" do
f = Exception.new("foo")
lambda { /foo/.match(f)[0] }.should raise_error(TypeError)
-> { /foo/.match(f)[0] }.should raise_error(TypeError)
end
end