Dave Johnston
2016-04-25 13:22:03 UTC
Hi,
I've been trying to write some tests for code that uses the
Fog::Orchestration::Openstack class.
I call a request method called 'list_resources'. The Mock for this request
looks like this:
class Mock
def list_resources(options = {}, options_deprecated = {})
resources = self.data[:resources].values
Excon::Response.new(
:body => { 'resources' => resources },
:status => 200
)
end
end
The tests fail because self.data[:resources] is nil. Does the Fog mock
framework provide a mechanism to populate the 'data' hash prior to
executing the test?
I've been trying to write some tests for code that uses the
Fog::Orchestration::Openstack class.
I call a request method called 'list_resources'. The Mock for this request
looks like this:
class Mock
def list_resources(options = {}, options_deprecated = {})
resources = self.data[:resources].values
Excon::Response.new(
:body => { 'resources' => resources },
:status => 200
)
end
end
The tests fail because self.data[:resources] is nil. Does the Fog mock
framework provide a mechanism to populate the 'data' hash prior to
executing the test?
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.