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.55.2 lib/pact/cli/spec_criteria.rb
pact-1.55.1 lib/pact/cli/spec_criteria.rb
pact-1.55.0 lib/pact/cli/spec_criteria.rb
pact-1.54.0 lib/pact/cli/spec_criteria.rb
pact-1.53.0 lib/pact/cli/spec_criteria.rb
pact-1.52.0 lib/pact/cli/spec_criteria.rb
pact-1.51.1 lib/pact/cli/spec_criteria.rb
pact-1.51.0 lib/pact/cli/spec_criteria.rb