lib/bogus/fake.rb in bogus-0.0.4 vs lib/bogus/fake.rb in bogus-0.1.0

- old
+ new

@@ -8,10 +8,11 @@ extend RecordInteractions include FakeObject extend FakeObject def initialize(*args) + __shadow__ end def to_s "#<#{self.class}:0x#{object_id.to_s(16)}>" end @@ -24,9 +25,16 @@ klass == self.class.__copied_class__ end class << self attr_accessor :__copied_class__ + + alias :__create__ :new + + def new(*args, &block) + __record__(:new, *args, &block) + __create__ + end def name __copied_class__.name end