Sha256: af9f7078a488fd8de8f7231a76cf1fb8709e383aca962e859aca9ed9ab70d08c

Contents?: true

Size: 370 Bytes

Versions: 7

Compression:

Stored size: 370 Bytes

Contents

module Pact
  module Doc
    class SortInteractions
      def self.call interactions
        interactions.sort{|a, b| sortable_id(a) <=> sortable_id(b)}
      end

      private

      def self.sortable_id interaction
        "#{interaction.description.downcase} #{interaction.response.status} #{(interaction.provider_state || '').downcase}"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pact_broker-2.17.1 lib/pact/doc/sort_interactions.rb
pact_broker-2.17.0 lib/pact/doc/sort_interactions.rb
pact_broker-2.16.1 lib/pact/doc/sort_interactions.rb
pact_broker-2.16.0 lib/pact/doc/sort_interactions.rb
pact_broker-2.15.0 lib/pact/doc/sort_interactions.rb
pact_broker-2.14.0 lib/pact/doc/sort_interactions.rb
pact_broker-2.13.1 lib/pact/doc/sort_interactions.rb