Sha256: 3d8f9e397f7fef9865216a1c04564e5778b7c864e19445e8d22f1c58ff94b768

Contents?: true

Size: 588 Bytes

Versions: 1

Compression:

Stored size: 588 Bytes

Contents

module Bogus
  module RSpecExtensions
    def fake(name, opts = {}, &block)
      let(name) { Bogus.fake_for(name, opts, &block) }
    end

    def verify_contract(name)
      before do
        Bogus.record_calls_for(name)
      end

      RSpec.configure do |config|
        config.after(:suite) { Bogus.verify_contract!(name) }
      end
    end
  end

  module MockingDSL
    def stub(object)
      Bogus.create_stub(object)
    end

    def have_received(method = nil)
      Bogus.have_received(method)
    end

    def mock(object)
      Bogus.create_mock(object)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bogus-0.0.1 lib/bogus/rspec_extensions.rb