diff options
Diffstat (limited to 'spec/ruby/optional/capi/struct_spec.rb')
-rw-r--r-- | spec/ruby/optional/capi/struct_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/ruby/optional/capi/struct_spec.rb b/spec/ruby/optional/capi/struct_spec.rb index 3b0972926c..6254b098a9 100644 --- a/spec/ruby/optional/capi/struct_spec.rb +++ b/spec/ruby/optional/capi/struct_spec.rb @@ -106,11 +106,11 @@ describe "C-API Struct function" do describe "rb_struct_define" do it "raises an ArgumentError if arguments contain duplicate member name" do - lambda { @s.rb_struct_define(nil, "a", "b", "a") }.should raise_error(ArgumentError) + -> { @s.rb_struct_define(nil, "a", "b", "a") }.should raise_error(ArgumentError) end it "raises a NameError if an invalid constant name is given" do - lambda { @s.rb_struct_define("foo", "a", "b", "c") }.should raise_error(NameError) + -> { @s.rb_struct_define("foo", "a", "b", "c") }.should raise_error(NameError) end end @@ -131,12 +131,12 @@ describe "C-API Struct function" do end it "raises a NameError if the struct member does not exist" do - lambda { @s.rb_struct_aref(@struct, :d) }.should raise_error(NameError) + -> { @s.rb_struct_aref(@struct, :d) }.should raise_error(NameError) end it "raises an IndexError if the given index is out of range" do - lambda { @s.rb_struct_aref(@struct, -4) }.should raise_error(IndexError) - lambda { @s.rb_struct_aref(@struct, 3) }.should raise_error(IndexError) + -> { @s.rb_struct_aref(@struct, -4) }.should raise_error(IndexError) + -> { @s.rb_struct_aref(@struct, 3) }.should raise_error(IndexError) end end @@ -147,7 +147,7 @@ describe "C-API Struct function" do end it "raises a NameError if the struct member does not exist" do - lambda { @s.rb_struct_getmember(@struct, :d) }.should raise_error(NameError) + -> { @s.rb_struct_getmember(@struct, :d) }.should raise_error(NameError) end end @@ -180,17 +180,17 @@ describe "C-API Struct function" do end it "raises a NameError if the struct member does not exist" do - lambda { @s.rb_struct_aset(@struct, :d, 1) }.should raise_error(NameError) + -> { @s.rb_struct_aset(@struct, :d, 1) }.should raise_error(NameError) end it "raises an IndexError if the given index is out of range" do - lambda { @s.rb_struct_aset(@struct, -4, 1) }.should raise_error(IndexError) - lambda { @s.rb_struct_aset(@struct, 3, 1) }.should raise_error(IndexError) + -> { @s.rb_struct_aset(@struct, -4, 1) }.should raise_error(IndexError) + -> { @s.rb_struct_aset(@struct, 3, 1) }.should raise_error(IndexError) end it "raises a #{frozen_error_class} if the struct is frozen" do @struct.freeze - lambda { @s.rb_struct_aset(@struct, :a, 1) }.should raise_error(frozen_error_class) + -> { @s.rb_struct_aset(@struct, :a, 1) }.should raise_error(frozen_error_class) end end |