Sha256: 317c9e2c16cd126c892e0ffcbcff2742c43c32378807aa8dfdfad95945c9e8ea
Contents?: true
Size: 853 Bytes
Versions: 47
Compression:
Stored size: 853 Bytes
Contents
require "spec_helper" describe Brightbox::Api, "#fog_model" do context "when initialised with a fog model" do before do @identifier = "api-12345" @fog_model = double expect(@fog_model).to receive(:id).and_return(@identifier) allow(@fog_model).to receive(:attributes).and_return({}) end it "returns the object" do @api_instance = Brightbox::Api.new(@fog_model) expect(@api_instance.fog_model).to eql(@fog_model) end end context "when initialised with an identifier string" do it "attempts to find a resource" do @identifier = "api-12345" @fog_model = double @api_instance = Brightbox::Api.new(@identifier) expect(Brightbox::Api).to receive(:find).with(@identifier).and_return(@fog_model) expect(@api_instance.fog_model).to eql(@fog_model) end end end
Version data entries
47 entries across 47 versions & 1 rubygems