Class: Pact::Provider::RSpec::PactBrokerFormatter
- Inherits:
-
RSpec::Core::Formatters::BaseFormatter
- Object
- RSpec::Core::Formatters::BaseFormatter
- Pact::Provider::RSpec::PactBrokerFormatter
- Defined in:
- lib/pact/provider/rspec/pact_broker_formatter.rb
Instance Attribute Summary collapse
-
#output_hash ⇒ Object
readonly
Returns the value of attribute output_hash.
Instance Method Summary collapse
- #close(_notification) ⇒ Object
-
#initialize(output) ⇒ PactBrokerFormatter
constructor
A new instance of PactBrokerFormatter.
- #stop(notification) ⇒ Object
Constructor Details
#initialize(output) ⇒ PactBrokerFormatter
Returns a new instance of PactBrokerFormatter.
16 17 18 19 |
# File 'lib/pact/provider/rspec/pact_broker_formatter.rb', line 16 def initialize(output) super @output_hash = {} end |
Instance Attribute Details
#output_hash ⇒ Object (readonly)
Returns the value of attribute output_hash.
14 15 16 |
# File 'lib/pact/provider/rspec/pact_broker_formatter.rb', line 14 def output_hash @output_hash end |
Instance Method Details
#close(_notification) ⇒ Object
27 28 29 |
# File 'lib/pact/provider/rspec/pact_broker_formatter.rb', line 27 def close(_notification) Pact::Provider::VerificationResults::PublishAll.call(Pact.provider_world.pact_sources, output_hash, { verbose: Pact.provider_world.verbose }) end |
#stop(notification) ⇒ Object
21 22 23 24 25 |
# File 'lib/pact/provider/rspec/pact_broker_formatter.rb', line 21 def stop(notification) @output_hash[:tests] = notification .examples .map { |example| format_example(example) } end |