Sha256: e14b7c54f71ac51ad764ceb45894a83669dfc801f693cf10bf7c132b50cc6d34

Contents?: true

Size: 675 Bytes

Versions: 1

Compression:

Stored size: 675 Bytes

Contents

require 'pact/provider/rspec'
require 'rspec/mocks'
require './spec/support/active_support_if_configured'

class StubbedThing
  def self.stub_me
  end
end

class App
  def self.call env
    [200, {}, [StubbedThing.stub_me]]
  end
end

Pact.provider_states_for 'Consumer' do
  provider_state 'something is stubbed' do
    set_up do
      allow(StubbedThing).to receive(:stub_me).and_return("stubbing works")
    end
  end
end

# Include the ExampleMethods module after the provider states are declared
# to ensure the ordering doesn't matter

Pact.configure do | config |
  config.include RSpec::Mocks::ExampleMethods
end

Pact.service_provider 'Provider' do
  app { App }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pact-1.1.1 spec/support/stubbing_using_allow.rb