Sha256: cee799283a3a9a85bd8012be0a85ce796f365e1d7c994270a8ceed353167147e

Contents?: true

Size: 595 Bytes

Versions: 14

Compression:

Stored size: 595 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.service_provider 'Provider' do
  app { App }
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
pact-mock_service-0.2.2 spec/support/stubbing_using_allow.rb
pact-mock_service-0.2.1 spec/support/stubbing_using_allow.rb
pact-mock_service-0.2.0 spec/support/stubbing_using_allow.rb
pact-1.4.0.rc4 spec/support/stubbing_using_allow.rb
pact-mock_service-0.1.0 spec/support/stubbing_using_allow.rb
pact-1.4.0.rc3 spec/support/stubbing_using_allow.rb
pact-1.4.0.rc2 spec/support/stubbing_using_allow.rb
pact-mock_service-0.0.1 spec/support/stubbing_using_allow.rb
pact-1.3.3 spec/support/stubbing_using_allow.rb
pact-1.3.2 spec/support/stubbing_using_allow.rb
pact-1.3.1 spec/support/stubbing_using_allow.rb
pact-1.3.0 spec/support/stubbing_using_allow.rb
pact-1.2.1.rc2 spec/support/stubbing_using_allow.rb
pact-1.2.1.rc1 spec/support/stubbing_using_allow.rb