[core] Fixed credential tests

Tests behavior when ENV['HOME'] is not a directory.
This commit is contained in:
Aaron Suggs 2011-05-13 18:14:32 -04:00
parent e0432b6f1c
commit e0b8606d85
1 changed files with 7 additions and 2 deletions

View File

@ -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')