spec/resource_spec.rb in vmware-vra-2.5.0 vs spec/resource_spec.rb in vmware-vra-2.5.1
- old
+ new
@@ -70,18 +70,18 @@
describe "#by_name" do
it "can lookup and return resource" do
resource = Vra::Resource.allocate
allow(resource).to receive(:name).and_return("host1234")
name = resource.name
- allow(Vra::Resources).to receive(:all).and_return([resource])
+ expect(Vra::Resources).to receive(:all).with(client).and_return([resource])
expect(Vra::Resource.by_name(client, name)).to eq(resource)
end
it "returns nil if nothing found" do
resource = Vra::Resource.allocate
allow(resource).to receive(:name).and_return("host1234")
name = "somethingelse1234"
- allow(Vra::Resources).to receive(:all).and_return([resource])
+ expect(Vra::Resources).to receive(:all).with(client).and_return([resource])
expect(Vra::Resource.by_name(client, name)).to be nil
end
end
describe "#initialize" do