diff --git a/lib/pact_broker/matrix/resolved_selector.rb b/lib/pact_broker/matrix/resolved_selector.rb index 4e9f984eb..ad7051a83 100644 --- a/lib/pact_broker/matrix/resolved_selector.rb +++ b/lib/pact_broker/matrix/resolved_selector.rb @@ -202,10 +202,10 @@ def description "the latest version of #{pacticipant_name} with tag #{tag} (#{pacticipant_version_number})" elsif latest_tagged? "the latest version of #{pacticipant_name} with tag #{tag} (no such version exists)" - elsif main_branch? && pacticipant_version_number.nil? - "a version of #{pacticipant_name} from the main branch (no such version exists)" elsif latest_from_main_branch? && pacticipant_version_number.nil? - "the latest version of #{pacticipant_name} from the main branch (no such verison exists)" + "the latest version of #{pacticipant_name} from the main branch (no versions exist for this branch)" + elsif main_branch? && pacticipant_version_number.nil? + "any version of #{pacticipant_name} from the main branch (no versions exist for this branch)" elsif latest_from_branch? && pacticipant_version_number "the latest version of #{pacticipant_name} from branch #{branch} (#{pacticipant_version_number})" elsif latest_from_branch? diff --git a/spec/lib/pact_broker/matrix/resolved_selector_spec.rb b/spec/lib/pact_broker/matrix/resolved_selector_spec.rb index 53f93f244..ef2002e5d 100644 --- a/spec/lib/pact_broker/matrix/resolved_selector_spec.rb +++ b/spec/lib/pact_broker/matrix/resolved_selector_spec.rb @@ -200,8 +200,9 @@ module Matrix context "when specified by main_branch" do let(:main_branch) { true } + let(:latest) { nil } - its(:description) { is_expected.to eq "a version of Foo from the main branch (no such version exists)" } + its(:description) { is_expected.to eq "any version of Foo from the main branch (no versions exist for this branch)" } its(:version_does_not_exist_description) { is_expected.to eq "No version of Foo from the main branch exists" } end @@ -209,7 +210,7 @@ module Matrix let(:main_branch) { true } let(:latest) { true } - its(:description) { is_expected.to eq "a version of Foo from the main branch (no such version exists)" } + its(:description) { is_expected.to eq "the latest version of Foo from the main branch (no versions exist for this branch)" } its(:version_does_not_exist_description) { is_expected.to eq "No version of Foo from the main branch exists" } end end