diff options
Diffstat (limited to 'spec/ruby/core/hash/shared')
| -rw-r--r-- | spec/ruby/core/hash/shared/comparison.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/hash/shared/replace.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/hash/shared/select.rb | 4 | ||||
| -rw-r--r-- | spec/ruby/core/hash/shared/store.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/hash/shared/to_s.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/hash/shared/update.rb | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/core/hash/shared/comparison.rb b/spec/ruby/core/hash/shared/comparison.rb index bbb9bfd6ad..07564e4cec 100644 --- a/spec/ruby/core/hash/shared/comparison.rb +++ b/spec/ruby/core/hash/shared/comparison.rb @@ -1,8 +1,8 @@ describe :hash_comparison, shared: true do it "raises a TypeError if the right operand is not a hash" do - lambda { { a: 1 }.send(@method, 1) }.should raise_error(TypeError) - lambda { { a: 1 }.send(@method, nil) }.should raise_error(TypeError) - lambda { { a: 1 }.send(@method, []) }.should raise_error(TypeError) + -> { { a: 1 }.send(@method, 1) }.should raise_error(TypeError) + -> { { a: 1 }.send(@method, nil) }.should raise_error(TypeError) + -> { { a: 1 }.send(@method, []) }.should raise_error(TypeError) end it "returns false if both hashes have the same keys but different values" do diff --git a/spec/ruby/core/hash/shared/replace.rb b/spec/ruby/core/hash/shared/replace.rb index eb51130781..b3d098763b 100644 --- a/spec/ruby/core/hash/shared/replace.rb +++ b/spec/ruby/core/hash/shared/replace.rb @@ -32,19 +32,19 @@ describe :hash_replace, shared: true do hash_a.default(5).should == 10 hash_a = Hash.new { |h, k| k * 5 } - hash_b = Hash.new(lambda { raise "Should not invoke lambda" }) + hash_b = Hash.new(-> { raise "Should not invoke lambda" }) hash_a.send(@method, hash_b) hash_a.default.should == hash_b.default end it "raises a #{frozen_error_class} if called on a frozen instance that would not be modified" do - lambda do + -> do HashSpecs.frozen_hash.send(@method, HashSpecs.frozen_hash) end.should raise_error(frozen_error_class) end it "raises a #{frozen_error_class} if called on a frozen instance that is modified" do - lambda do + -> do HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) end.should raise_error(frozen_error_class) end diff --git a/spec/ruby/core/hash/shared/select.rb b/spec/ruby/core/hash/shared/select.rb index cc1a54da25..bb781817cb 100644 --- a/spec/ruby/core/hash/shared/select.rb +++ b/spec/ruby/core/hash/shared/select.rb @@ -75,11 +75,11 @@ describe :hash_select!, shared: true do end it "raises a #{frozen_error_class} if called on an empty frozen instance" do - lambda { HashSpecs.empty_frozen_hash.send(@method) { false } }.should raise_error(frozen_error_class) + -> { HashSpecs.empty_frozen_hash.send(@method) { false } }.should raise_error(frozen_error_class) end it "raises a #{frozen_error_class} if called on a frozen instance that would not be modified" do - lambda { HashSpecs.frozen_hash.send(@method) { true } }.should raise_error(frozen_error_class) + -> { HashSpecs.frozen_hash.send(@method) { true } }.should raise_error(frozen_error_class) end it_should_behave_like :hash_iteration_no_block diff --git a/spec/ruby/core/hash/shared/store.rb b/spec/ruby/core/hash/shared/store.rb index de61ed1ad1..ff40bef3ef 100644 --- a/spec/ruby/core/hash/shared/store.rb +++ b/spec/ruby/core/hash/shared/store.rb @@ -87,7 +87,7 @@ describe :hash_store, shared: true do end it "raises a #{frozen_error_class} if called on a frozen instance" do - lambda { HashSpecs.frozen_hash.send(@method, 1, 2) }.should raise_error(frozen_error_class) + -> { HashSpecs.frozen_hash.send(@method, 1, 2) }.should raise_error(frozen_error_class) end it "does not raise an exception if changing the value of an existing key during iteration" do diff --git a/spec/ruby/core/hash/shared/to_s.rb b/spec/ruby/core/hash/shared/to_s.rb index 88333e0f42..d180d08c2c 100644 --- a/spec/ruby/core/hash/shared/to_s.rb +++ b/spec/ruby/core/hash/shared/to_s.rb @@ -61,7 +61,7 @@ describe :hash_to_s, shared: true do obj.should_receive(:inspect).and_return(obj) obj.should_receive(:to_s).and_raise(Exception) - lambda { { a: obj }.send(@method) }.should raise_error(Exception) + -> { { a: obj }.send(@method) }.should raise_error(Exception) end it "handles hashes with recursive values" do diff --git a/spec/ruby/core/hash/shared/update.rb b/spec/ruby/core/hash/shared/update.rb index e808add5c0..3af41c450a 100644 --- a/spec/ruby/core/hash/shared/update.rb +++ b/spec/ruby/core/hash/shared/update.rb @@ -35,7 +35,7 @@ describe :hash_update, shared: true do end it "raises a #{frozen_error_class} on a frozen instance that is modified" do - lambda do + -> do HashSpecs.frozen_hash.send(@method, 1 => 2) end.should raise_error(frozen_error_class) end @@ -47,12 +47,12 @@ describe :hash_update, shared: true do def obj.to_hash() raise Exception, "should not receive #to_hash" end obj.freeze - lambda { HashSpecs.frozen_hash.send(@method, obj) }.should raise_error(frozen_error_class) + -> { HashSpecs.frozen_hash.send(@method, obj) }.should raise_error(frozen_error_class) end # see redmine #1571 it "raises a #{frozen_error_class} on a frozen instance that would not be modified" do - lambda do + -> do HashSpecs.frozen_hash.send(@method, HashSpecs.empty_frozen_hash) end.should raise_error(frozen_error_class) end |
