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/binding | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
download | ruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/binding')
-rw-r--r-- | spec/ruby/core/binding/local_variable_defined_spec.rb | 2 | ||||
-rw-r--r-- | spec/ruby/core/binding/local_variable_get_spec.rb | 12 | ||||
-rw-r--r-- | spec/ruby/core/binding/local_variable_set_spec.rb | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/spec/ruby/core/binding/local_variable_defined_spec.rb b/spec/ruby/core/binding/local_variable_defined_spec.rb index 7b48257294..2fc6504ee5 100644 --- a/spec/ruby/core/binding/local_variable_defined_spec.rb +++ b/spec/ruby/core/binding/local_variable_defined_spec.rb @@ -26,7 +26,7 @@ describe 'Binding#local_variable_defined?' do it 'returns true when a local variable is defined in a parent scope' do foo = 10 - lambda { + -> { binding.local_variable_defined?(:foo) }.call.should == true end diff --git a/spec/ruby/core/binding/local_variable_get_spec.rb b/spec/ruby/core/binding/local_variable_get_spec.rb index eeb3ae44ed..005670becc 100644 --- a/spec/ruby/core/binding/local_variable_get_spec.rb +++ b/spec/ruby/core/binding/local_variable_get_spec.rb @@ -11,7 +11,7 @@ describe "Binding#local_variable_get" do it "raises a NameError for missing variables" do bind = BindingSpecs::Demo.new(1).get_empty_binding - lambda { + -> { bind.local_variable_get(:no_such_variable) }.should raise_error(NameError) end @@ -19,7 +19,7 @@ describe "Binding#local_variable_get" do it "reads variables added later to the binding" do bind = BindingSpecs::Demo.new(1).get_empty_binding - lambda { + -> { bind.local_variable_get(:a) }.should raise_error(NameError) @@ -31,7 +31,7 @@ describe "Binding#local_variable_get" do it 'gets a local variable defined in a parent scope' do number = 10 - lambda { + -> { binding.local_variable_get(:number) }.call.should == 10 end @@ -45,12 +45,12 @@ describe "Binding#local_variable_get" do it "raises a NameError on global access" do bind = binding - lambda { bind.local_variable_get(:$0) }.should raise_error(NameError) + -> { bind.local_variable_get(:$0) }.should raise_error(NameError) end it "raises a NameError on special variable access" do bind = binding - lambda { bind.local_variable_get(:$~) }.should raise_error(NameError) - lambda { bind.local_variable_get(:$_) }.should raise_error(NameError) + -> { bind.local_variable_get(:$~) }.should raise_error(NameError) + -> { bind.local_variable_get(:$_) }.should raise_error(NameError) end end diff --git a/spec/ruby/core/binding/local_variable_set_spec.rb b/spec/ruby/core/binding/local_variable_set_spec.rb index 035e9a3c2e..1456c6dda1 100644 --- a/spec/ruby/core/binding/local_variable_set_spec.rb +++ b/spec/ruby/core/binding/local_variable_set_spec.rb @@ -38,7 +38,7 @@ describe "Binding#local_variable_set" do bind = binding bind.local_variable_set(:number, 10) - lambda { number }.should raise_error(NameError) + -> { number }.should raise_error(NameError) end it 'overwrites an existing local variable defined before a Binding' do @@ -59,13 +59,13 @@ describe "Binding#local_variable_set" do it "raises a NameError on global access" do bind = binding - lambda { bind.local_variable_set(:$0, "") }.should raise_error(NameError) + -> { bind.local_variable_set(:$0, "") }.should raise_error(NameError) end it "raises a NameError on special variable access" do bind = binding - lambda { bind.local_variable_set(:$~, "") }.should raise_error(NameError) - lambda { bind.local_variable_set(:$_, "") }.should raise_error(NameError) + -> { bind.local_variable_set(:$~, "") }.should raise_error(NameError) + -> { bind.local_variable_set(:$_, "") }.should raise_error(NameError) end end |