Skip to content

Commit

Permalink
Re-splat arguments for the have_enqueued_job alias
Browse files Browse the repository at this point in the history
This makes sure that an extra level of array wrapping isn't added for
tests which use the now-deprecated have_enqueued_job, which causes test
failures.
  • Loading branch information
aprescott committed Jun 23, 2017
1 parent 280877e commit 7934bba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rspec/sidekiq/matchers/have_enqueued_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def have_enqueued_sidekiq_job(*expected_arguments)

def have_enqueued_job(*expected_arguments)
warn "[DEPRECATION] `have_enqueued_job` is deprecated. Please use `have_enqueued_sidekiq_job` instead."
have_enqueued_sidekiq_job(expected_arguments)
have_enqueued_sidekiq_job(*expected_arguments)
end

class JobOptionParser
Expand Down
4 changes: 4 additions & 0 deletions spec/rspec/sidekiq/matchers/have_enqueued_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
it 'provides deprecation warning' do
expect { have_enqueued_job }.to output(/[DEPRECATION]/).to_stderr
end

it 'matches the same way have_enqueued_sidekiq_job does' do
expect(worker).to have_enqueued_job *worker_args
end
end

describe '#description' do
Expand Down

0 comments on commit 7934bba

Please sign in to comment.