oesmith / puffing-billy

A rewriting web proxy for testing interactions between your browser and external sites. Works with ruby + rspec.
MIT License
660 stars 168 forks source link

Expose stub instances via puffing billy #224

Closed AlanFoster closed 6 years ago

AlanFoster commented 6 years ago

It would be nice to expose the currently registered stubbed instances via puffing billy. This will allow for developers to learn which stubs were not correctly called, or are dead:

Billy.configure do |c|
  c.record_stub_requests = true
end

config.after(:example, type: :feature) do
  unused_stubs = proxy.stubs.select { |stub| stub.requests.empty? }
  expect(unused_proxy_stubs).to be_empty, "expected all stubs to be used, however no requests were received for #{unused_proxy_stubs}"
end
ronwsmith commented 6 years ago

Thanks for the contribution! I'll try to get this in soon.

ronwsmith commented 6 years ago

@AlanFoster can you resolve the conflicts here?

AlanFoster commented 6 years ago

@ronwsmith Resolved! :)

ronwsmith commented 6 years ago

Released in 1.1.0