Sha256: 46fd709811028619e86fdd3ed3ece0d9035d9132337d567d9346d4ffdbca0865

Contents?: true

Size: 751 Bytes

Versions: 12

Compression:

Stored size: 751 Bytes

Contents

module Pact
  module Provider
    class PrintMissingProviderStates

      # Hash of consumer names to array of names of missing provider states
      def self.call missing_provider_states
        if missing_provider_states.any?
          puts orangeify(text(missing_provider_states))
        end
      end

      def self.orangeify string
        "\e[33m#{string}\e[m"
      end

      def self.text missing_provider_states
        create_provider_states_for(missing_provider_states)
      end

      def self.create_provider_states_for consumers
        ERB.new(template_string).result(binding)
      end

      def self.template_string
        File.read(File.expand_path( '../../templates/provider_state.erb', __FILE__))
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
pact-1.1.0.rc1 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.37 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.36 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.35 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.34 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.33 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.32 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.31 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.30 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.29 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.28 lib/pact/provider/print_missing_provider_states.rb
pact-1.0.27 lib/pact/provider/print_missing_provider_states.rb