1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/opennebula/models/compute/flavors_tests.rb
Paul Thornthwaite a759f97388 Rescue opennebula loading issues
`require "opennebula"` fails when downstream tries to require `xmlrpc`
which is not included within the main `fog` dependencies.

The problem is that the `LoadError` was being trapped by
`Fog::SevicesMixin#new` so it was reporting that the OpenNebula provider
did not offer the service.

This then handles the `Fog::Errors::LoadError` in all the shindo tests
that halted the run. These tests will be pending unless `opennebula` is
installed.
2018-06-19 11:44:01 +01:00

19 lines
782 B
Ruby

Shindo.tests('Fog::Compute[:opennebula] | flavors collection', ['opennebula']) do
begin
flavors = Fog::Compute[:opennebula].flavors
rescue Fog::Errors::LoadError
pending
end
tests('The flavors collection should') do
test('should be a kind of Fog::Compute::OpenNebula::Flavors') { flavors.kind_of? Fog::Compute::OpenNebula::Flavors }
tests('should be able to reload itself').succeeds { flavors.reload }
tests('should be able to get models') do
tests('all').succeeds { flavors.all }
tests('by instance id').succeeds { flavors.get flavors.first.id }
tests('by name').succeeds { flavors.get_by_name "fogtest" }
tests('by filter').succeeds { flavors.get_by_filter ({:name => "fogtest", :id => flavors.first.id }) }
end
end
end