Sha256: b19975251dc9e2694e83e80af6c9c9ef83e2a4e9a9277c29b0169cc764382fa7
Contents?: true
Size: 890 Bytes
Versions: 15
Compression:
Stored size: 890 Bytes
Contents
module Mocktail class HandlesDryNewCall def initialize @validates_arguments = ValidatesArguments.new @logs_call = LogsCall.new @fulfills_stubbing = FulfillsStubbing.new @imitates_type = ImitatesType.new end def handle(type, args, kwargs, block) @validates_arguments.validate(Call.new( original_method: type.instance_method(:initialize), args: args, kwargs: kwargs, block: block )) new_call = Call.new( singleton: true, double: type, original_type: type, dry_type: type, method: :new, args: args, kwargs: kwargs, block: block ) @logs_call.log(new_call) if @fulfills_stubbing.satisfaction(new_call) @fulfills_stubbing.fulfill(new_call) else @imitates_type.imitate(type) end end end end
Version data entries
15 entries across 15 versions & 1 rubygems