aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/module/deprecate_constant_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/module/deprecate_constant_spec.rb
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
downloadruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/module/deprecate_constant_spec.rb')
-rw-r--r--spec/ruby/core/module/deprecate_constant_spec.rb14
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