Skip to content

Commit

Permalink
feat(cli): output HTTP request and response debugging when verbose mo…
Browse files Browse the repository at this point in the history
…de enabled
  • Loading branch information
bethesque committed Dec 22, 2017
1 parent 283887d commit f487714
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/pact_broker/client/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def initialize options
@client_options = options[:client_options] || {}
@verbose = @client_options[:verbose]
self.class.base_uri base_url
self.class.debug_output($stderr) if verbose?
self.class.basic_auth(client_options[:basic_auth][:username], client_options[:basic_auth][:password]) if client_options[:basic_auth]
end

Expand Down
2 changes: 0 additions & 2 deletions lib/pact_broker/client/matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ def get selectors, options = {}
latestby: latestby
}.merge(query_options(options))
response = self.class.get("/matrix", query: query, headers: default_get_headers)
$stdout.puts("DEBUG: Response headers #{response.headers}") if verbose?
$stdout.puts("DEBUG: Response body #{response}") if verbose?
response = handle_response(response) do
JSON.parse(response.body, symbolize_names: true)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/can_i_deploy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
end

context "when the pacticipants can be deployed" do
subject { `bundle exec bin/pact-broker can-i-deploy -v --pacticipant Foo --version 1.2.3 --pacticipant Bar --version 4.5.6 --broker-base-url http://localhost:5000` }
subject { `bundle exec bin/pact-broker can-i-deploy --pacticipant Foo --version 1.2.3 --pacticipant Bar --version 4.5.6 --broker-base-url http://localhost:5000` }

it "returns a success exit code" do
subject
Expand All @@ -18,7 +18,7 @@
end

context "when the pacticipants can't be deployed" do
subject { `bundle exec bin/pact-broker can-i-deploy -v --pacticipant Wiffle --version 1.2.3 --pacticipant Meep --version 4.5.6 --broker-base-url http://localhost:5000` }
subject { `bundle exec bin/pact-broker can-i-deploy --pacticipant Wiffle --version 1.2.3 --pacticipant Meep --version 4.5.6 --broker-base-url http://localhost:5000` }

it "returns an error exit code" do
subject
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/create_version_tag_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
end

context "when the version is successfully tagged" do
subject { `bundle exec bin/pact-broker create-version-tag -v --pacticipant Condor --version 1.3.0 --tag prod --broker-base-url http://localhost:5001` }
subject { `bundle exec bin/pact-broker create-version-tag --pacticipant Condor --version 1.3.0 --tag prod --broker-base-url http://localhost:5001` }

it "returns a success exit code" do
subject
Expand Down

0 comments on commit f487714

Please sign in to comment.