Sha256: b2b938049f8b1256403121a0e4187ec22ecd760eb2aee3240b057f018d14ae75
Contents?: true
Size: 626 Bytes
Versions: 12
Compression:
Stored size: 626 Bytes
Contents
class Bogus::RecordingProxy < BasicObject extend ::Bogus::Takes takes :instance, :fake_name, :interactions_repository def method_missing(name, *args, &block) returned_value = @instance.__send__(name, *args, &block) @interactions_repository.record(@fake_name, name, *args) { returned_value } returned_value rescue => e @interactions_repository.record(@fake_name, name, *args) { ::Kernel.raise(e) } ::Kernel.raise end # apparently even BasicObject has an equality operator def ==(other) method_missing(:==, other) end def respond_to?(name) @instance.respond_to?(name) end end
Version data entries
12 entries across 12 versions & 1 rubygems