Sha256: 7b98b606200f0789b5d455d207890e4028d2b62d0621bb7abd3353827d0a0a44

Contents?: true

Size: 752 Bytes

Versions: 28

Compression:

Stored size: 752 Bytes

Contents

module Pact
  module Cli
    class SpecCriteria

      def self.call options
        criteria = {}

        criteria[:description] = Regexp.new(options[:description]) if options[:description]
        criteria[:_id] = options[:pact_broker_interaction_id] if options[:pact_broker_interaction_id]
        criteria[:index] = options[:interaction_index] if options[:interaction_index]

        provider_state = options[:provider_state]

        if provider_state
          if provider_state.length == 0
            criteria[:provider_state] = nil #Allow PACT_PROVIDER_STATE="" to mean no provider state
          else
            criteria[:provider_state] = Regexp.new(provider_state)
          end
        end

        criteria
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
pact-1.66.1 lib/pact/cli/spec_criteria.rb
pact-1.66.0 lib/pact/cli/spec_criteria.rb
pact-1.65.3 lib/pact/cli/spec_criteria.rb
pact-1.65.2 lib/pact/cli/spec_criteria.rb
pact-1.65.1 lib/pact/cli/spec_criteria.rb
pact-1.65.0 lib/pact/cli/spec_criteria.rb
pact-1.64.0 lib/pact/cli/spec_criteria.rb
pact-1.63.0 lib/pact/cli/spec_criteria.rb
pact-1.62.0 lib/pact/cli/spec_criteria.rb
pact-1.61.0 lib/pact/cli/spec_criteria.rb
pact-1.60.0 lib/pact/cli/spec_criteria.rb
pact-1.59.0 lib/pact/cli/spec_criteria.rb
pact-1.58.0 lib/pact/cli/spec_criteria.rb
pact-1.57.0 lib/pact/cli/spec_criteria.rb
pact-1.56.0 lib/pact/cli/spec_criteria.rb
pact-1.55.7 lib/pact/cli/spec_criteria.rb
pact-1.55.6 lib/pact/cli/spec_criteria.rb
pact-1.55.5 lib/pact/cli/spec_criteria.rb
pact-1.55.4 lib/pact/cli/spec_criteria.rb
pact-1.55.3 lib/pact/cli/spec_criteria.rb