Skip to content
This repository has been archived by the owner on Nov 8, 2018. It is now read-only.

Commit

Permalink
Merge pull request #35 from jmcarp/conditional-deprecation
Browse files Browse the repository at this point in the history
Skip deprecation warning when version set to every.
  • Loading branch information
jtarchie authored Sep 27, 2016
2 parents 9881575 + 14df65d commit 687fe0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 3 additions & 1 deletion assets/lib/in.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
9 changes: 8 additions & 1 deletion spec/integration/in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 687fe0f

Please sign in to comment.