Skip to content

Commit

Permalink
Merge pull request #54 from anynines/ds_563_parse_credhub
Browse files Browse the repository at this point in the history
[DS-564] CredHub client returning JSON instead of string (2)
  • Loading branch information
a9shdemelo authored Mar 11, 2021
2 parents a134696 + c08d1ca commit 3790835
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/unit_tests_utils/credhub.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class UnitTestsUtils::CredHub
COMMAND_FAIL_PREFIX_MESSAGE = 'CredHub command failed:'

def self.get_by_name(name)
execute(GET_COMMAND, "--name='#{name}'")
stdout, stderr = execute(GET_COMMAND, "--name='#{name}'")
return JSON.parse(stdout), stderr
end

private
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/unit_tests_utils/credhub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
msg_expected = "#{UnitTestsUtils::CredHub::COMMAND_FAIL_PREFIX_MESSAGE} #{command_expected}"
allow(UnitTestsUtils::Cmd).to receive(:exec)
.with(command_expected, msg_expected)
.and_return({})
.and_return('{}')

get_by_name
end
Expand Down

0 comments on commit 3790835

Please sign in to comment.