Sha256: c088ba756fb37a207cda97482709564cc169a7dd8ff73fb4e0fe6134c60c5b61

Contents?: true

Size: 833 Bytes

Versions: 3

Compression:

Stored size: 833 Bytes

Contents

require './lib/pact/producer/pact_spec_runner'

namespace :pact do

	desc 'Runs pact tests against a sample application, testing failure and success.'
	task :tests do
		puts "Running task pact:tests"
		# Run these specs silently, otherwise expected failures will be written to stdout and look like unexpected failures.

		result = Pact::Producer::PactSpecRunner.run([{ uri: './spec/support/test_app_pass.json', support_file: './spec/support/pact_rake_support.rb', consumer: 'some-test-consumer' }], silent: true)
		fail 'Expected pact to pass' unless (result == 0)

		result = Pact::Producer::PactSpecRunner.run([{ uri: './spec/support/test_app_fail.json', support_file: './spec/support/pact_rake_support.rb' }], silent: true)
		fail 'Expected pact to fail' if (result == 0)

		puts "Task pact:tests completed succesfully."
	end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pact-0.1.37 tasks/pact-test.rake
pact-0.1.35 tasks/pact-test.rake
pact-0.1.28 tasks/pact-test.rake