Class: Pact::Provider::PactSpecRunner

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

Constant Summary collapse

SUPPORT_FILE_DEPRECATION_MESSAGE =
"The :support_file option is deprecated. " +
"The preferred way to specify a support file is to create a pact_helper.rb in one of the following paths: " +
Pact::Provider::PactHelperLocater::PACT_HELPER_FILE_PATTERNS.join(", ") +
". If you cannot do this, you may use the :pact_helper option in place of the :support_file option."

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RSpec::ClassMethods

#honour_consumer_contract, #honour_pactfile

Constructor Details

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

Returns a new instance of PactSpecRunner.



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

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

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#outputObject (readonly)

Returns the value of attribute output.



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

def output
  @output
end

#spec_definitionsObject (readonly)

Returns the value of attribute spec_definitions.



21
22
23
# File 'lib/pact/provider/pact_spec_runner.rb', line 21

def spec_definitions
  @spec_definitions
end

Instance Method Details

#runObject



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

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