diff options
Diffstat (limited to 'spec/ruby/core/objectspace/weakmap/shared/each.rb')
| -rw-r--r-- | spec/ruby/core/objectspace/weakmap/shared/each.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/ruby/core/objectspace/weakmap/shared/each.rb b/spec/ruby/core/objectspace/weakmap/shared/each.rb new file mode 100644 index 0000000000..3d43a19347 --- /dev/null +++ b/spec/ruby/core/objectspace/weakmap/shared/each.rb @@ -0,0 +1,10 @@ +describe :weakmap_each, shared: true do + it "must take a block, except when empty" do + map = ObjectSpace::WeakMap.new + key = "a".upcase + ref = "x" + map.send(@method).should == map + map[key] = ref + -> { map.send(@method) }.should raise_error(LocalJumpError) + end +end |
