diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
commit | 5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch) | |
tree | 05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/optional/capi/struct_spec.rb | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
download | ruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz |
Update to ruby/spec@875a09e
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 |