Skip to content

Commit

Permalink
git push origin masterMerge branch 'bmxpert1-retry-fix'
Browse files Browse the repository at this point in the history
  • Loading branch information
didil committed May 13, 2014
2 parents f33f9fd + 8bcc3e3 commit ad478a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sidekiq_client_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def run

# set queue or retry if they are not given
settings.queue ||= Sidekiq.default_worker_options['queue']
settings.retry ||= Sidekiq.default_worker_options['retry']
settings.retry = Sidekiq.default_worker_options['retry'] if settings.retry.nil?

self.send settings.command.to_sym
end
Expand Down
25 changes: 25 additions & 0 deletions spec/sidekiq_client_cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,31 @@
@client.run
end

it "doesnt try to change the retry value if it has been set to false" do
config_path = "sidekiq.conf"
@client.settings.stub(:config_path).and_return(config_path)
@client.settings.stub(:command).and_return("mycommand")
@client.settings.stub(:queue).and_return(default_queue)
@client.settings.stub(:retry).and_return(false)

@client.should_receive(:mycommand)
@client.should_not_receive(:retry=)

@client.run
end

it "doesnt try to change the retry value if it has been set to true" do
config_path = "sidekiq.conf"
@client.settings.stub(:config_path).and_return(config_path)
@client.settings.stub(:command).and_return("mycommand")
@client.settings.stub(:queue).and_return(default_queue)
@client.settings.stub(:retry).and_return(true)

@client.should_receive(:mycommand)
@client.should_not_receive(:retry=)

@client.run
end
end

describe 'push' do
Expand Down

0 comments on commit ad478a8

Please sign in to comment.