Sha256: 0437c220bfad9b9726d9cbbfbaa1d6c0335d72b312a7402b2acc3e4abf596c0b

Contents?: true

Size: 621 Bytes

Versions: 9

Compression:

Stored size: 621 Bytes

Contents

require 'pact/provider/rspec'
require 'rspec/mocks'

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

9 entries across 9 versions & 1 rubygems

Version Path
pact-1.1.0 spec/support/stubbing_using_allow.rb
pact-1.1.0.rc5 spec/support/stubbing_using_allow.rb
pact-1.1.0.rc4 spec/support/stubbing_using_allow.rb
pact-1.1.0.rc3 spec/support/stubbing_using_allow.rb
pact-1.0.39 spec/support/stubbing_using_allow.rb
pact-1.1.0.rc2 spec/support/stubbing_using_allow.rb
pact-1.0.38 spec/support/stubbing_using_allow.rb
pact-1.1.0.rc1 spec/support/stubbing_using_allow.rb
pact-1.0.37 spec/support/stubbing_using_allow.rb