Sha256: ec9420b042c860fcd353ba8504f68e49d9336174b152adbf4e9866cb3cbde1c4

Contents?: true

Size: 348 Bytes

Versions: 12

Compression:

Stored size: 348 Bytes

Contents

module Bogus
  class MultiStubber
    extend Takes
    takes :create_double

    def stub_all(object, methods = {})
      double = create_double.call(object)
      methods.each do |name, result|
        block = result.is_a?(Proc) ? result : proc{ result }
        double.stubs(name, Bogus::AnyArgs, &block)
      end
      object
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
bogus-0.1.7 lib/bogus/stubbing/multi_stubber.rb
bogus-0.1.6 lib/bogus/stubbing/multi_stubber.rb
bogus-0.1.5 lib/bogus/stubbing/multi_stubber.rb
bogus-0.1.4 lib/bogus/stubbing/multi_stubber.rb
bogus-0.1.3 lib/bogus/multi_stubber.rb
bogus-0.1.2 lib/bogus/multi_stubber.rb
bogus-0.1.1 lib/bogus/multi_stubber.rb
bogus-0.1.0 lib/bogus/multi_stubber.rb
bogus-0.0.4 lib/bogus/multi_stubber.rb
bogus-0.0.3 lib/bogus/multi_stubber.rb
bogus-0.0.3.rc.2 lib/bogus/multi_stubber.rb
bogus-0.0.3.rc.1 lib/bogus/multi_stubber.rb