diff options
Diffstat (limited to 'spec/ruby/core/objectspace/weakmap/shared')
| -rw-r--r-- | spec/ruby/core/objectspace/weakmap/shared/each.rb | 2 | ||||
| -rw-r--r-- | spec/ruby/core/objectspace/weakmap/shared/include.rb | 30 | ||||
| -rw-r--r-- | spec/ruby/core/objectspace/weakmap/shared/size.rb | 14 |
3 files changed, 1 insertions, 45 deletions
diff --git a/spec/ruby/core/objectspace/weakmap/shared/each.rb b/spec/ruby/core/objectspace/weakmap/shared/each.rb index 3d43a19347..771c416dde 100644 --- a/spec/ruby/core/objectspace/weakmap/shared/each.rb +++ b/spec/ruby/core/objectspace/weakmap/shared/each.rb @@ -5,6 +5,6 @@ describe :weakmap_each, shared: true do ref = "x" map.send(@method).should == map map[key] = ref - -> { map.send(@method) }.should raise_error(LocalJumpError) + -> { map.send(@method) }.should.raise(LocalJumpError) end end diff --git a/spec/ruby/core/objectspace/weakmap/shared/include.rb b/spec/ruby/core/objectspace/weakmap/shared/include.rb deleted file mode 100644 index 1770eeac8b..0000000000 --- a/spec/ruby/core/objectspace/weakmap/shared/include.rb +++ /dev/null @@ -1,30 +0,0 @@ -describe :weakmap_include?, shared: true do - it "recognizes keys in use" do - map = ObjectSpace::WeakMap.new - key1, key2 = %w[a b].map(&:upcase) - ref1, ref2 = %w[x y] - - map[key1] = ref1 - map.send(@method, key1).should == true - map[key1] = ref1 - map.send(@method, key1).should == true - map[key2] = ref2 - map.send(@method, key2).should == true - end - - it "matches using identity semantics" do - map = ObjectSpace::WeakMap.new - key1, key2 = %w[a a].map(&:upcase) - ref = "x" - map[key1] = ref - map.send(@method, key2).should == false - end - - it "reports true if the pair exists and the value is nil" do - map = ObjectSpace::WeakMap.new - key = Object.new - map[key] = nil - map.size.should == 1 - map.send(@method, key).should == true - end -end diff --git a/spec/ruby/core/objectspace/weakmap/shared/size.rb b/spec/ruby/core/objectspace/weakmap/shared/size.rb deleted file mode 100644 index 1064f99d1b..0000000000 --- a/spec/ruby/core/objectspace/weakmap/shared/size.rb +++ /dev/null @@ -1,14 +0,0 @@ -describe :weakmap_size, shared: true do - it "is correct" do - map = ObjectSpace::WeakMap.new - key1, key2 = %w[a b].map(&:upcase) - ref1, ref2 = %w[x y] - map.send(@method).should == 0 - map[key1] = ref1 - map.send(@method).should == 1 - map[key1] = ref1 - map.send(@method).should == 1 - map[key2] = ref2 - map.send(@method).should == 2 - end -end |
