aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/hash
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-05-03 12:28:29 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-05-03 12:28:29 +0200
commit5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 (patch)
treee1694f5a4a5558884b1b8f3890b186793e5e982f /spec/ruby/core/hash
parentf646d20aaeb8f02bcd3d0c5c3f5a372da654502a (diff)
downloadruby-5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39.tar.gz
Update to ruby/spec@032ee74
Diffstat (limited to 'spec/ruby/core/hash')
-rw-r--r--spec/ruby/core/hash/any_spec.rb4
-rw-r--r--spec/ruby/core/hash/compare_by_identity_spec.rb2
-rw-r--r--spec/ruby/core/hash/empty_spec.rb10
-rw-r--r--spec/ruby/core/hash/reject_spec.rb2
-rw-r--r--spec/ruby/core/hash/shared/store.rb2
-rw-r--r--spec/ruby/core/hash/to_proc_spec.rb4
6 files changed, 12 insertions, 12 deletions
diff --git a/spec/ruby/core/hash/any_spec.rb b/spec/ruby/core/hash/any_spec.rb
index bd33e8cd8f..c26dfabde6 100644
--- a/spec/ruby/core/hash/any_spec.rb
+++ b/spec/ruby/core/hash/any_spec.rb
@@ -4,10 +4,10 @@ describe "Hash#any?" do
describe 'with no block given' do
it "checks if there are any members of a Hash" do
empty_hash = {}
- empty_hash.any?.should == false
+ empty_hash.should_not.any?
hash_with_members = { 'key' => 'value' }
- hash_with_members.any?.should == true
+ hash_with_members.should.any?
end
end
diff --git a/spec/ruby/core/hash/compare_by_identity_spec.rb b/spec/ruby/core/hash/compare_by_identity_spec.rb
index 0fd41a4d58..874cd46eb7 100644
--- a/spec/ruby/core/hash/compare_by_identity_spec.rb
+++ b/spec/ruby/core/hash/compare_by_identity_spec.rb
@@ -33,7 +33,7 @@ describe "Hash#compare_by_identity" do
it "has no effect on an already compare_by_identity hash" do
@idh[:foo] = :bar
@idh.compare_by_identity.should equal @idh
- @idh.compare_by_identity?.should == true
+ @idh.should.compare_by_identity?
@idh[:foo].should == :bar
end
diff --git a/spec/ruby/core/hash/empty_spec.rb b/spec/ruby/core/hash/empty_spec.rb
index e9be44bab0..881e1cc34b 100644
--- a/spec/ruby/core/hash/empty_spec.rb
+++ b/spec/ruby/core/hash/empty_spec.rb
@@ -3,13 +3,13 @@ require_relative 'fixtures/classes'
describe "Hash#empty?" do
it "returns true if the hash has no entries" do
- {}.empty?.should == true
- { 1 => 1 }.empty?.should == false
+ {}.should.empty?
+ { 1 => 1 }.should_not.empty?
end
it "returns true if the hash has no entries and has a default value" do
- Hash.new(5).empty?.should == true
- Hash.new { 5 }.empty?.should == true
- Hash.new { |hsh, k| hsh[k] = k }.empty?.should == true
+ Hash.new(5).should.empty?
+ Hash.new { 5 }.should.empty?
+ Hash.new { |hsh, k| hsh[k] = k }.should.empty?
end
end
diff --git a/spec/ruby/core/hash/reject_spec.rb b/spec/ruby/core/hash/reject_spec.rb
index 38589fd880..397000ab67 100644
--- a/spec/ruby/core/hash/reject_spec.rb
+++ b/spec/ruby/core/hash/reject_spec.rb
@@ -35,7 +35,7 @@ describe "Hash#reject" do
ruby_version_is ''...'2.7' do
it "does not taint the resulting hash" do
h = { a: 1 }.taint
- h.reject {false}.tainted?.should == false
+ h.reject {false}.should_not.tainted?
end
end
end
diff --git a/spec/ruby/core/hash/shared/store.rb b/spec/ruby/core/hash/shared/store.rb
index 6e2557eb28..84ffb41e33 100644
--- a/spec/ruby/core/hash/shared/store.rb
+++ b/spec/ruby/core/hash/shared/store.rb
@@ -50,7 +50,7 @@ describe :hash_store, shared: true do
key << "bar"
h.should == { "foo" => 0 }
- h.keys[0].frozen?.should == true
+ h.keys[0].should.frozen?
end
it "doesn't duplicate and freeze already frozen string keys" do
diff --git a/spec/ruby/core/hash/to_proc_spec.rb b/spec/ruby/core/hash/to_proc_spec.rb
index 700621f162..8b7ddd5e00 100644
--- a/spec/ruby/core/hash/to_proc_spec.rb
+++ b/spec/ruby/core/hash/to_proc_spec.rb
@@ -21,13 +21,13 @@ describe "Hash#to_proc" do
ruby_version_is ""..."2.8" do
it "is not a lambda" do
- @proc.lambda?.should == false
+ @proc.should_not.lambda?
end
end
ruby_version_is "2.8" do
it "is a lambda" do
- @proc.lambda?.should == true
+ @proc.should.lambda?
end
end