Skip to content

Commit

Permalink
feat(can-i-deploy): include full response body in json output
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Oct 27, 2017
1 parent bfd0882 commit 216bfdc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/pact_broker/client/can_i_deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def success_message(matrix)
end

def failure_message(matrix)
message = format_matrix(matrix[:matrix])
message = format_matrix(matrix)
if format != 'json'
message = 'Computer says no ¯\_(ツ)_/¯' + "\n\n" + message
end
Expand Down
4 changes: 2 additions & 2 deletions lib/pact_broker/client/matrix/json_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ module PactBroker
module Client
class Matrix
class JsonFormatter
def self.call(matrix_lines)
JSON.pretty_generate(matrix: matrix_lines)
def self.call(matrix)
JSON.pretty_generate(matrix)
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/pact_broker/client/matrix/text_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class TextFormatter

Line = Struct.new(:consumer, :consumer_version, :provider, :provider_version, :success)

def self.call(matrix_lines)
data = matrix_lines.collect do | line |
def self.call(matrix)
data = matrix[:matrix].collect do | line |
Line.new(
lookup(line, :consumer, :name),
lookup(line, :consumer, :version, :number),
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/pact_broker/client/matrix/text_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Client

# SublimeText removes whitespace from the end of files when you save them,
# so removing trailing whitespace before comparing
subject { Matrix::TextFormatter.call(matrix_lines).split("\n").collect(&:strip).join("\n") }
subject { Matrix::TextFormatter.call(matrix: matrix_lines).split("\n").collect(&:strip).join("\n") }

context "with valid data" do
it "it has the right text" do
Expand Down

0 comments on commit 216bfdc

Please sign in to comment.