2011-12-02 10:27:44 -08:00
|
|
|
Shindo.tests('Fog::Compute[:ibm] | keys', ['ibm']) do
|
|
|
|
|
|
|
|
tests('success') do
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
@key_name = "fog test key"
|
|
|
|
@key = nil
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
tests("Fog::Compute[:ibm].keys.create('#{@key_name}')") do
|
|
|
|
@key = Fog::Compute[:ibm].keys.create(@key_name)
|
|
|
|
returns(@key_name) { @key.name }
|
|
|
|
end
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
tests('Fog::Compute[:ibm].keys') do
|
|
|
|
returns(true) { Fog::Compute[:ibm].keys.length > 0 }
|
|
|
|
end
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
tests("Fog::Compute[:ibm].keys.default = '#{@key_name}'") do
|
|
|
|
returns(@key_name) { Fog::Compute[:ibm].keys.default = @key_name }
|
|
|
|
end
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
tests("Fog::Compute[:ibm].keys.default") do
|
|
|
|
@key = Fog::Compute[:ibm].keys.get(@key_name)
|
|
|
|
returns(@key.name) { Fog::Compute[:ibm].keys.default.name }
|
|
|
|
end
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
tests("Fog::Compute[:ibm].keys.get('#{@key_name}')") do
|
|
|
|
key = Fog::Compute[:ibm].keys.get(@key_name)
|
|
|
|
returns(@key_name) { key.name }
|
|
|
|
end
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
@key.destroy
|
2012-02-13 10:51:03 -05:00
|
|
|
|
2011-12-02 10:27:44 -08:00
|
|
|
end
|
2012-02-13 10:51:03 -05:00
|
|
|
|
|
|
|
end
|