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/module_function_spec.rb | |
| parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/module/module_function_spec.rb')
| -rw-r--r-- | spec/ruby/core/module/module_function_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/module/module_function_spec.rb b/spec/ruby/core/module/module_function_spec.rb index 41d52849fd..407237d48f 100644 --- a/spec/ruby/core/module/module_function_spec.rb +++ b/spec/ruby/core/module/module_function_spec.rb @@ -12,11 +12,11 @@ describe "Module#module_function" do end it "raises a TypeError if calling after rebinded to Class" do - lambda { + -> { Module.instance_method(:module_function).bind(Class.new).call }.should raise_error(TypeError) - lambda { + -> { Module.instance_method(:module_function).bind(Class.new).call :foo }.should raise_error(TypeError) end @@ -87,7 +87,7 @@ describe "Module#module_function with specific method names" do o.respond_to?(:test).should == false m.should have_private_instance_method(:test) o.send(:test).should == "hello" - lambda { o.test }.should raise_error(NoMethodError) + -> { o.test }.should raise_error(NoMethodError) end it "makes the new Module methods public" do @@ -116,10 +116,10 @@ describe "Module#module_function with specific method names" do it "raises a TypeError when the given names can't be converted to string using to_str" do o = mock('123') - lambda { Module.new { module_function(o) } }.should raise_error(TypeError) + -> { Module.new { module_function(o) } }.should raise_error(TypeError) o.should_receive(:to_str).and_return(123) - lambda { Module.new { module_function(o) } }.should raise_error(TypeError) + -> { Module.new { module_function(o) } }.should raise_error(TypeError) end it "can make accessible private methods" do # JRUBY-4214 |
