Excon::Response.new(
:body => { 'resources' => resources },
:status => 200
)
end
end
`
The error occurs because self.data[:resources] is nil, so .values being called on a Nil class.
Is there a correct method to populate self.data? in the Mock class, prior to executing the test?
I can't see a recommended approach.
I'm currently writing tests for code that uses Openstack Orchestration requests.
One of the test fails, when I looked at the Mock for list_resources
`class Mock def list_resources(options = {}, options_deprecated = {}) puts "YYY Resources: #{self.data}" resources = self.data[:resources].values
`
The error occurs because self.data[:resources] is nil, so .values being called on a Nil class. Is there a correct method to populate self.data? in the Mock class, prior to executing the test?
I can't see a recommended approach.