diff options
Diffstat (limited to 'spec/ruby/optional/capi/util_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/util_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/optional/capi/util_spec.rb b/spec/ruby/optional/capi/util_spec.rb index 5f8f9c6e3b..cd6c1105e2 100644 --- a/spec/ruby/optional/capi/util_spec.rb +++ b/spec/ruby/optional/capi/util_spec.rb @@ -9,7 +9,7 @@ describe "C-API Util function" do describe "rb_scan_args" do before :each do - @prc = lambda { 1 } + @prc = -> { 1 } @acc = [] ScratchPad.record @acc end @@ -20,11 +20,11 @@ describe "C-API Util function" do end it "raises an ArgumentError if there are insufficient arguments" do - lambda { @o.rb_scan_args([1, 2], "3", 0, @acc) }.should raise_error(ArgumentError) + -> { @o.rb_scan_args([1, 2], "3", 0, @acc) }.should raise_error(ArgumentError) end it "raises an ArgumentError if there are too many arguments" do - lambda { @o.rb_scan_args([1, 2, 3, 4], "3", 0, @acc) }.should raise_error(ArgumentError) + -> { @o.rb_scan_args([1, 2, 3, 4], "3", 0, @acc) }.should raise_error(ArgumentError) end it "assigns the required and optional arguments scanned" do @@ -133,7 +133,7 @@ describe "C-API Util function" do # r43934 it "rejects non-keyword arguments" do h = {1 => 2, 3 => 4} - lambda { + -> { @o.rb_scan_args([h], "0:", 1, @acc) }.should raise_error(ArgumentError) ScratchPad.recorded.should == [] @@ -141,7 +141,7 @@ describe "C-API Util function" do it "rejects required and non-keyword arguments" do h = {1 => 2, 3 => 4} - lambda { + -> { @o.rb_scan_args([1, h], "1:", 2, @acc) }.should raise_error(ArgumentError) ScratchPad.recorded.should == [] @@ -175,7 +175,7 @@ describe "C-API Util function" do it "raises an error if a required argument is not in the hash" do h = { :a => 7, :c => 12, :b => 5 } - lambda { @o.rb_get_kwargs(h, [:b, :d], 2, 0) }.should raise_error(ArgumentError, /missing keyword: d/) + -> { @o.rb_get_kwargs(h, [:b, :d], 2, 0) }.should raise_error(ArgumentError, /missing keyword: d/) h.should == {:a => 7, :c => 12} end @@ -187,7 +187,7 @@ describe "C-API Util function" do it "raises an error if there are additional arguments and optional is positive" do h = { :a => 7, :c => 12, :b => 5 } - lambda { @o.rb_get_kwargs(h, [:b, :a], 2, 0) }.should raise_error(ArgumentError, /unknown keyword: c/) + -> { @o.rb_get_kwargs(h, [:b, :a], 2, 0) }.should raise_error(ArgumentError, /unknown keyword: c/) h.should == {:c => 12} end @@ -201,7 +201,7 @@ describe "C-API Util function" do platform_is wordsize: 64 do describe "rb_long2int" do it "raises a RangeError if the value is outside the range of a C int" do - lambda { @o.rb_long2int(0xffff_ffff_ffff) }.should raise_error(RangeError) + -> { @o.rb_long2int(0xffff_ffff_ffff) }.should raise_error(RangeError) end end |