Class: Pact::Provider::PactSpecRunner

Inherits:
Object
  • Object
show all
Includes:
RSpec::ClassMethods
Defined in:
lib/pact/provider/pact_spec_runner.rb

Defined Under Namespace

Classes: NoConfigurationOptions

Constant Summary

Constants included from RSpec::ClassMethods

RSpec::ClassMethods::EMPTY_ARRAY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RSpec::ClassMethods

#honour_consumer_contract, #honour_pactfile

Constructor Details

#initialize(pact_urls, options = {}) ⇒ PactSpecRunner

Returns a new instance of PactSpecRunner.



26
27
28
29
30
# File 'lib/pact/provider/pact_spec_runner.rb', line 26

def initialize pact_urls, options = {}
  @pact_urls = pact_urls
  @options = options
  @results = nil
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



24
25
26
# File 'lib/pact/provider/pact_spec_runner.rb', line 24

def options
  @options
end

#pact_urlsObject (readonly)

Returns the value of attribute pact_urls.



23
24
25
# File 'lib/pact/provider/pact_spec_runner.rb', line 23

def pact_urls
  @pact_urls
end

Instance Method Details

#runObject



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/pact/provider/pact_spec_runner.rb', line 32

def run
  begin
    configure_rspec
    initialize_specs
    run_specs
  ensure
    ::RSpec.reset
    Pact.clear_provider_world
    Pact.clear_consumer_world
  end
end