test/backgrounded_test.rb in backgrounded-0.4.1 vs test/backgrounded_test.rb in backgrounded-0.5.0
- old
+ new
@@ -1,6 +1,6 @@
-require 'test_helper'
+require File.join(File.dirname(__FILE__), 'test_helper')
class User
backgrounded :do_stuff
def do_stuff
@@ -28,10 +28,17 @@
def delete_spam!
end
end
+class Dog
+ backgrounded :bark => {:priority => :low}
+
+ def bark
+ end
+end
+
class BackgroundedTest < Test::Unit::TestCase
context 'an object with a single backgrounded method' do
setup do
@user = User.new
end
@@ -68,8 +75,17 @@
@post.expects(:do_stuff)
@post.do_stuff_backgrounded
@post.expects(:notify_users)
@post.notify_users_backgrounded
+ end
+ end
+
+ context 'an object with backgrounded method options' do
+ setup do
+ @dog = Dog.new
+ end
+ should 'save method options for future use' do
+ assert_equal :low, @dog.backgrounded_options[:bark][:priority]
end
end
end