diff --git a/lib/unit_tests_utils/credhub.rb b/lib/unit_tests_utils/credhub.rb index 57f6441..c7bb092 100644 --- a/lib/unit_tests_utils/credhub.rb +++ b/lib/unit_tests_utils/credhub.rb @@ -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 diff --git a/spec/lib/unit_tests_utils/credhub_spec.rb b/spec/lib/unit_tests_utils/credhub_spec.rb index c7c5e37..fe9154b 100644 --- a/spec/lib/unit_tests_utils/credhub_spec.rb +++ b/spec/lib/unit_tests_utils/credhub_spec.rb @@ -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