Permalink
Browse files

inspecting return values before returning

  • Loading branch information...
1 parent a4fd2bb commit e736269fc1ff89005587f32e59b7324165f08d35 @jeffkreeftmeijer committed Jul 11, 2010
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/navvy/job.rb
  2. +3 −3 spec/job_spec.rb
View
@@ -64,7 +64,7 @@ def self.keep?
def run
begin
started
- result = constantize(object).send(method_name, *args)
+ result = constantize(object).send(method_name, *args).inspect
Navvy::Job.keep? ? completed(result) : destroy
result
rescue Exception => exception
View
@@ -202,15 +202,15 @@
it 'should run the job and delete it' do
jobs = Navvy::Job.next
- jobs.first.run.should == 'moo'
+ jobs.first.run.should == '"moo"'
job_count.should == 0
end
describe 'when Navvy::Job.keep is set' do
it 'should call #completed with the return value after processing the job' do
Navvy::Job.keep = true
jobs = Navvy::Job.next
- jobs.first.should_receive(:completed).with('moo')
+ jobs.first.should_receive(:completed).with('"moo"')
jobs.first.run
end
@@ -495,7 +495,7 @@
describe '#namespaced' do
it 'should accept a namespaced class name' do
job = Navvy::Job.enqueue(Animals::Cow, :speak)
- job.run.should == 'moo'
+ job.run.should == '"moo"'
end
end
end

0 comments on commit e736269

Please sign in to comment.