diff options
Diffstat (limited to 'spec/ruby/core/module/deprecate_constant_spec.rb')
-rw-r--r-- | spec/ruby/core/module/deprecate_constant_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/module/deprecate_constant_spec.rb b/spec/ruby/core/module/deprecate_constant_spec.rb index 0954a6d8a5..7bcced981b 100644 --- a/spec/ruby/core/module/deprecate_constant_spec.rb +++ b/spec/ruby/core/module/deprecate_constant_spec.rb @@ -17,27 +17,27 @@ describe "Module#deprecate_constant" do @module.deprecate_constant :PUBLIC1 value = nil - lambda { + -> { value = @module::PUBLIC1 }.should complain(@pattern) value.should equal(@value) - lambda { @module::PRIVATE }.should raise_error(NameError) + -> { @module::PRIVATE }.should raise_error(NameError) end it "warns with a message" do @module.deprecate_constant :PUBLIC1 - lambda { @module::PUBLIC1 }.should complain(@pattern) - lambda { @module.const_get :PRIVATE }.should complain(@pattern) + -> { @module::PUBLIC1 }.should complain(@pattern) + -> { @module.const_get :PRIVATE }.should complain(@pattern) end end it "accepts multiple symbols and strings as constant names" do @module.deprecate_constant "PUBLIC1", :PUBLIC2 - lambda { @module::PUBLIC1 }.should complain(@pattern) - lambda { @module::PUBLIC2 }.should complain(@pattern) + -> { @module::PUBLIC1 }.should complain(@pattern) + -> { @module::PUBLIC2 }.should complain(@pattern) end it "returns self" do @@ -45,6 +45,6 @@ describe "Module#deprecate_constant" do end it "raises a NameError when given an undefined name" do - lambda { @module.deprecate_constant :UNDEFINED }.should raise_error(NameError) + -> { @module.deprecate_constant :UNDEFINED }.should raise_error(NameError) end end |