Sha256: fcbde1595d40d2b5cebf2a494a988074ebb8fa7c3acda3276eb206f5b2c0962f
Contents?: true
Size: 952 Bytes
Versions: 83
Compression:
Stored size: 952 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures' # NOTE: A call to define_finalizer does not guarantee that the # passed proc or callable will be called at any particular time. # It is highly questionable whether these aspects of ObjectSpace # should be spec'd at all. describe "ObjectSpace.define_finalizer" do it "raises an ArgumentError if the action does not respond to call" do lambda { ObjectSpace.define_finalizer("", 3) }.should raise_error(ArgumentError) end it "accepts an object and a proc" do handler = lambda { |obj| obj } ObjectSpace.define_finalizer("garbage", handler).should == [0, handler] end it "accepts an object and a callable" do handler = mock("callable") def handler.call(obj) end ObjectSpace.define_finalizer("garbage", handler).should == [0, handler] end end
Version data entries
83 entries across 83 versions & 1 rubygems