diff --git a/assets/lib/in.rb b/assets/lib/in.rb index 7468102..f6cf2f4 100755 --- a/assets/lib/in.rb +++ b/assets/lib/in.rb @@ -19,7 +19,9 @@ def remote_ref params['fetch_merge'] ? 'merge' : 'head' end -$stderr.puts 'DEPRECATION: Please note that you should update to using `version: every` on your `get` for this resource.' +if input['source']['every'] + $stderr.puts 'DEPRECATION: Please note that you should update to using `version: every` on your `get` for this resource.' +end pr = Octokit.pull_request(input['source']['repo'], input['version']['pr']) id = pr['number'] diff --git a/spec/integration/in_spec.rb b/spec/integration/in_spec.rb index 2d8c14f..1da02eb 100644 --- a/spec/integration/in_spec.rb +++ b/spec/integration/in_spec.rb @@ -77,8 +77,15 @@ def commit(msg) end context 'when `every` is not defined' do - it 'shows a deprecation warning' do + it 'skips the deprecation warning' do _, error = get(version: { ref: @ref, pr: '1' }, source: { uri: git_uri, repo: 'jtarchie/test' }) + expect(error).not_to include 'DEPRECATION: Please note that you should update to using `version: every` on your `get` for this resource.' + end + end + + context 'when `every` is defined' do + it 'shows a deprecation warning' do + _, error = get(version: { ref: @ref, pr: '1' }, source: { uri: git_uri, repo: 'jtarchie/test', every: true }) expect(error).to include 'DEPRECATION: Please note that you should update to using `version: every` on your `get` for this resource.' end end