File tree Expand file tree Collapse file tree
lib/pact/provider/verification_results
spec/lib/pact/provider/verification_results Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ def tag_versions
8181 provider_application_version = Pact . configuration . provider . application_version
8282
8383 Pact . configuration . provider . tags . each do | tag |
84+ Pact . configuration . output_stream . puts "INFO: Tagging version #{ provider_application_version } of #{ provider_name } as #{ tag . inspect } "
8485 tag_entity = tag_link . expand ( version : provider_application_version , tag : tag ) . put
8586 unless tag_entity . success?
8687 raise PublicationError . new ( "Error returned from tagging request #{ tag_entity . response . code } #{ tag_entity . response . body } " )
@@ -109,6 +110,10 @@ def publish_verification_results
109110 def consumer_name
110111 pact_source . pact_hash [ 'consumer' ] [ 'name' ]
111112 end
113+
114+ def provider_name
115+ pact_source . pact_hash [ 'provider' ] [ 'name' ]
116+ end
112117 end
113118 end
114119 end
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ module VerificationResults
1717 'consumer' => {
1818 'name' => 'Foo'
1919 } ,
20+ 'provider' => {
21+ 'name' => 'Bar'
22+ } ,
2023 '_links' => {
2124 'pb:publish-verification-results' => {
2225 'href' => publish_verification_url
@@ -121,6 +124,11 @@ module VerificationResults
121124 expect ( WebMock ) . to have_requested ( :put , 'http://provider/version/1.2.3/tag/foo' ) . with ( headers : { 'Content-Type' => 'application/json' } )
122125 end
123126
127+ it "logs the tagging to stdout" do
128+ expect ( $stdout) . to receive ( :puts ) . with ( "INFO: Tagging version 1.2.3 of Bar as \" foo\" " )
129+ subject
130+ end
131+
124132 context "when there is no pb:publish-verification-results link" do
125133 before do
126134 pact_hash [ '_links' ] . delete ( 'pb:publish-verification-results' )
You can’t perform that action at this time.
0 commit comments