Sha256: 0b9470ae1062cbcdf6374601dbd06b7cd8921aeeb9560a8d82351b1442e0b015

Contents?: true

Size: 869 Bytes

Versions: 1

Compression:

Stored size: 869 Bytes

Contents

module Bogus
  module PublicMethods

    def fake_for(*args, &block)
      inject.creates_fakes.create(*args, &block)
    end

    def record_calls_for(name)
      inject.adds_recording.add(name)
    end

    def verify_contract!(fake_name)
      inject.verifies_contracts.verify(fake_name)
    end

    def configure(&block)
      config.tap(&block)
    end

    def config
      inject.configuration
    end

    def reset!
      @injector = Bogus::Injector.new
    end

    def create_stub(*args)
      inject.create_stub(*args)
    end

    def create_mock(*args)
      inject.create_mock(*args)
    end

    def have_received(*args)
      inject.invocation_matcher(*args)
    end

    def create_anonymous_stub(*args)
      inject.creates_anonymous_stubs.create(*args)
    end

    private

    def inject
      @injector ||= Bogus::Injector.new
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bogus-0.0.2 lib/bogus/public_methods.rb