Permalink
Browse files

Update spec

  • Loading branch information...
1 parent e132b5d commit 83fe8d85b15da17cff26c87aa1d65d3e419504cb @bkeepers bkeepers committed Sep 9, 2010
Showing with 6 additions and 7 deletions.
  1. +6 −7 spec/performable_method_spec.rb
@@ -20,13 +20,6 @@
@method.object.should_receive(:count).with('o')
@method.perform
end
-
- it "should respond to failure when implemented and target object is called via object.delay.do_something" do
- @method = Delayed::PerformableMethod.new(OnPermanentFailureJob.new, :perform, [])
- @method.respond_to?(:failure).should be_true
- @method.object.should_receive(:failure)
- @method.failure
- end
end
it "should raise a NoMethodError if target method doesn't exist" do
@@ -61,5 +54,11 @@ def private_method
story.should_receive(:tell).and_raise(RuntimeError)
lambda { story.delay.tell.invoke_job }.should raise_error
end
+
+ it "should delegate failure hook to object" do
+ method = Delayed::PerformableMethod.new("object", :size, [])
+ method.object.should_receive(:failure)
+ method.failure
+ end
end
end

0 comments on commit 83fe8d8

Please sign in to comment.