Sha256: f6d995b2a4d7b969a117b13a3939d5eac9fa923455b3b271122922094c39eb05

Contents?: true

Size: 1.03 KB

Versions: 40

Compression:

Stored size: 1.03 KB

Contents

require 'pact_broker/client/cli/broker'

RSpec.describe "describe-environment" do
  let(:index_body_hash) do
    {
      _links: {
        "pb:pacticipant" => {
          href: "http://broker/pacticipants/{pacticipant}"
        }
      }
    }
  end

  let(:pacticipant_body_hash) { JSON.parse(File.read("./spec/support/pacticipant_get.json")) }

  let!(:index_request) do
    stub_request(:get, "http://broker").to_return(status: 200, body: index_body_hash.to_json, headers: { "Content-Type" => "application/hal+json" }  )
  end

  let!(:pacticipant_request) do
    stub_request(:get, "http://broker/pacticipants/Foo").to_return(status: 200, body: pacticipant_body_hash.to_json, headers: { "Content-Type" => "application/hal+json" }  )
  end

  let(:parameters) { %w{describe-pacticipant --name Foo --broker-base-url http://broker} }

  subject { capture(:stdout) { PactBroker::Client::CLI::Broker.start(parameters) } }

  it "prints the pacticipant properties" do
    Approvals.verify(subject, :name => "describe_pacticipant", format: :txt)
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
pact_broker-client-1.75.3 spec/integration/describe_environment_spec.rb
pact_broker-client-1.75.1 spec/integration/describe_environment_spec.rb
pact_broker-client-1.75.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.74.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.73.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.72.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.71.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.70.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.69.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.68.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.67.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.66.1 spec/integration/describe_environment_spec.rb
pact_broker-client-1.66.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.65.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.64.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.63.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.62.1 spec/integration/describe_environment_spec.rb
pact_broker-client-1.62.0 spec/integration/describe_environment_spec.rb
pact_broker-client-1.61.1 spec/integration/describe_environment_spec.rb
pact_broker-client-1.61.0 spec/integration/describe_environment_spec.rb