Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Commit

Permalink
Specs FTW.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Mitchell committed Jul 22, 2010
1 parent c31cffd commit 2e885cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kestrel/client/reliable.rb
Expand Up @@ -38,7 +38,7 @@ def get(key, opts = false)
end

def current_try
@job ? 1 : @job.retries + 1
@job ? @job.retries + 1 : 1
end

# Enqueues the current job on the error queue for later
Expand Down
10 changes: 10 additions & 0 deletions spec/kestrel/client/reliable_spec.rb
Expand Up @@ -53,6 +53,16 @@
@kestrel.get(@queue).should be_nil
end

it "returns the payload of a RetryableJob" do
stub(@kestrel).rand { 0 }
mock(@raw_kestrel_client).get(@queue + "_errors", anything) do
Kestrel::Client::Reliable::RetryableJob.new(1, :mcmuffin)
end

@kestrel.get(@queue).should == :mcmuffin
@kestrel.current_try.should == 2
end

end

describe "#abort" do
Expand Down

0 comments on commit 2e885cb

Please sign in to comment.