Skip to content

Commit

Permalink
test: add test for when branch deleting is not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Nov 9, 2023
1 parent 3714d31 commit a6aa9f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/client/branches/delete_branch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Client
module Branches
class DeleteBranch < PactBroker::Client::BaseCommand

NOT_SUPPORTED_MESSAGE_PACT_BROKER = "This version of the Pact Broker does not support deleting branches. Please upgrade to version X or later."
NOT_SUPPORTED_MESSAGE_PACTFLOW = "This version of PactFlow does not support deleting branches. Please upgrade to version X or later."
NOT_SUPPORTED_MESSAGE_PACT_BROKER = "This version of the Pact Broker does not support deleting branches. Please upgrade to version 2.108.0 or later."
NOT_SUPPORTED_MESSAGE_PACTFLOW = "This version of PactFlow does not support deleting branches. Please upgrade to the latest version."

def initialize(params, options, pact_broker_client_options)
super
Expand Down
13 changes: 13 additions & 0 deletions spec/lib/pact_broker/client/branches/delete_branch_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ module Branches
end
end
end

context "when deleting branches is not supported" do
let(:index_response_body) do
{
_links: {}
}.to_json
end

it "returns an error" do
expect(subject.success).to be false
expect(subject.message).to include "not support"
end
end
end
end
end
Expand Down

0 comments on commit a6aa9f2

Please sign in to comment.