diff options
Diffstat (limited to 'spec/ruby/core/module/remove_method_spec.rb')
-rw-r--r-- | spec/ruby/core/module/remove_method_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/core/module/remove_method_spec.rb b/spec/ruby/core/module/remove_method_spec.rb index f83928f715..70048a83fb 100644 --- a/spec/ruby/core/module/remove_method_spec.rb +++ b/spec/ruby/core/module/remove_method_spec.rb @@ -77,19 +77,19 @@ describe "Module#remove_method" do end it "raises a NameError when attempting to remove method further up the inheritance tree" do - lambda { - class Third < ModuleSpecs::Second + Class.new(ModuleSpecs::Second) do + -> { remove_method :method_to_remove - end - }.should raise_error(NameError) + }.should raise_error(NameError) + end end it "raises a NameError when attempting to remove a missing method" do - lambda { - class Third < ModuleSpecs::Second + Class.new(ModuleSpecs::Second) do + -> { remove_method :blah - end - }.should raise_error(NameError) + }.should raise_error(NameError) + end end describe "on frozen instance" do |