spec/unit/berkshelf/api_client/connection_spec.rb in berkshelf-api-client-1.1.0 vs spec/unit/berkshelf/api_client/connection_spec.rb in berkshelf-api-client-1.1.1

- old
+ new

@@ -51,7 +51,17 @@ it "has a location_type for each" do subject.each do |remote| expect(remote.location_type).to_not be_nil end end + + context "when the connection to the service fails" do + before do + instance.should_receive(:get).and_raise(Faraday::Error::ConnectionFailed.new(StandardError)) + end + + it "raises a Berkshelf::APIClient::ServiceUnavaiable" do + expect { subject }.to raise_error(Berkshelf::APIClient::ServiceUnavaiable) + end + end end end