Sha256: d03fa7c1f921bcaf8a3e9350a843f63acf1c88bf0825618f13b7669c382230d2

Contents?: true

Size: 1.03 KB

Versions: 5

Compression:

Stored size: 1.03 KB

Contents

namespace :pact do

  desc "Verifies the pact files configured in the pact_helper.rb against this service provider."
  task :verify do
    require 'pact/provider'
    require 'pact/tasks/task_helper'
    require 'pact/provider/client_project_pact_helper'

    include Pact::TaskHelper

    handle_verification_failure do
      pact_verifications = Pact.configuration.pact_verifications
      verification_configs = pact_verifications.collect { | pact_verification | { :uri => pact_verification.uri }}
      raise "Please configure a pact to verify" if verification_configs.empty?
      Pact::Provider::PactSpecRunner.new(verification_configs).run
    end
  end

  desc "Verifies the pact at the given URI against this service provider."
  task 'verify:at', :pact_uri do | t, args |
    require 'pact/provider'
    require 'pact/tasks/task_helper'

    include Pact::TaskHelper

    handle_verification_failure do
      puts "Verifying pact at uri #{args[:pact_uri]}"
      Pact::Provider::PactSpecRunner.new([{uri: args[:pact_uri]}]).run
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pact-1.0.15 lib/tasks/pact.rake
pact-1.0.13 lib/tasks/pact.rake
pact-1.0.12 lib/tasks/pact.rake
pact-1.0.11 lib/tasks/pact.rake
pact-1.0.10 lib/tasks/pact.rake