diff options
Diffstat (limited to 'spec/ruby/core/regexp/match_spec.rb')
-rw-r--r-- | spec/ruby/core/regexp/match_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/regexp/match_spec.rb b/spec/ruby/core/regexp/match_spec.rb index ebbba38211..a68448b39c 100644 --- a/spec/ruby/core/regexp/match_spec.rb +++ b/spec/ruby/core/regexp/match_spec.rb @@ -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 |