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/core/module/undef_method_spec.rb | |
| parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/module/undef_method_spec.rb')
| -rw-r--r-- | spec/ruby/core/module/undef_method_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/ruby/core/module/undef_method_spec.rb b/spec/ruby/core/module/undef_method_spec.rb index 539de330e9..9b2c9240f4 100644 --- a/spec/ruby/core/module/undef_method_spec.rb +++ b/spec/ruby/core/module/undef_method_spec.rb @@ -41,8 +41,8 @@ describe "Module#undef_method" do x = klass.new klass.send(:undef_method, :method_to_undef, :another_method_to_undef) - lambda { x.method_to_undef }.should raise_error(NoMethodError) - lambda { x.another_method_to_undef }.should raise_error(NoMethodError) + -> { x.method_to_undef }.should raise_error(NoMethodError) + -> { x.another_method_to_undef }.should raise_error(NoMethodError) end it "does not undef any instance methods when argument not given" do @@ -57,7 +57,7 @@ describe "Module#undef_method" do end it "raises a NameError when passed a missing name" do - lambda { @module.send :undef_method, :not_exist }.should raise_error(NameError) { |e| + -> { @module.send :undef_method, :not_exist }.should raise_error(NameError) { |e| # a NameError and not a NoMethodError e.class.should == NameError } @@ -69,15 +69,15 @@ describe "Module#undef_method" do end it "raises a #{frozen_error_class} when passed a name" do - lambda { @frozen.send :undef_method, :method_to_undef }.should raise_error(frozen_error_class) + -> { @frozen.send :undef_method, :method_to_undef }.should raise_error(frozen_error_class) end it "raises a #{frozen_error_class} when passed a missing name" do - lambda { @frozen.send :undef_method, :not_exist }.should raise_error(frozen_error_class) + -> { @frozen.send :undef_method, :not_exist }.should raise_error(frozen_error_class) end it "raises a TypeError when passed a not name" do - lambda { @frozen.send :undef_method, Object.new }.should raise_error(TypeError) + -> { @frozen.send :undef_method, Object.new }.should raise_error(TypeError) end it "does not raise exceptions when no arguments given" do @@ -98,7 +98,7 @@ describe "Module#undef_method with symbol" do klass.send :undef_method, :method_to_undef - lambda { x.method_to_undef }.should raise_error(NoMethodError) + -> { x.method_to_undef }.should raise_error(NoMethodError) end it "removes a method defined in a super class" do @@ -108,7 +108,7 @@ describe "Module#undef_method with symbol" do child_class.send :undef_method, :method_to_undef - lambda { child.method_to_undef }.should raise_error(NoMethodError) + -> { child.method_to_undef }.should raise_error(NoMethodError) end it "does not remove a method defined in a super class when removed from a subclass" do @@ -134,7 +134,7 @@ describe "Module#undef_method with string" do klass.send :undef_method, 'another_method_to_undef' - lambda { x.another_method_to_undef }.should raise_error(NoMethodError) + -> { x.another_method_to_undef }.should raise_error(NoMethodError) end it "removes a method defined in a super class" do @@ -144,7 +144,7 @@ describe "Module#undef_method with string" do child_class.send :undef_method, 'another_method_to_undef' - lambda { child.another_method_to_undef }.should raise_error(NoMethodError) + -> { child.another_method_to_undef }.should raise_error(NoMethodError) end it "does not remove a method defined in a super class when removed from a subclass" do |
