From e0b8606d85e3dd0f97a4a406a10639f138274da2 Mon Sep 17 00:00:00 2001 From: Aaron Suggs Date: Fri, 13 May 2011 18:14:32 -0400 Subject: [PATCH] [core] Fixed credential tests Tests behavior when ENV['HOME'] is not a directory. --- tests/core/credential_tests.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/core/credential_tests.rb b/tests/core/credential_tests.rb index 9eeac4fac..4780c3357 100644 --- a/tests/core/credential_tests.rb +++ b/tests/core/credential_tests.rb @@ -21,12 +21,17 @@ Shindo.tests do Fog.credentials_path } - returns('/home/me/.fog', 'falls back to home path if FOG_RC not set') { - ENV['HOME'] = '/home/me' + returns(File.join(ENV['HOME'], '.fog'), 'falls back to home path if FOG_RC not set') { ENV.delete('FOG_RC') Fog.credentials_path } + returns(nil, 'ignores home path if it does not exist') { + ENV.delete('FOG_RC') + ENV['HOME'] = '/no/such/path' + Fog.credentials_path + } + returns(nil, 'returns nil when neither FOG_RC or HOME are set') { ENV.delete('HOME') ENV.delete('FOG_RC')