Permalink
Browse files

Test cleanup

  • Loading branch information...
1 parent 3ce19eb commit b782c05e1beb311e7299da5f1bb48d7a20794a3f @mperham committed Mar 18, 2012
Showing with 7 additions and 6 deletions.
  1. +2 −1 Rakefile
  2. +0 −4 test/test_extensions.rb
  3. +5 −1 test/test_retry.rb
View
@@ -1,7 +1,8 @@
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'test'
- test.warning = true
+ #SO MUCH NOISE
+ #test.warning = true
test.pattern = 'test/**/test_*.rb'
end
@@ -28,10 +28,6 @@ def self.long_class_method
assert_equal 1, Sidekiq.redis.llen('queue:default')
end
- it 'allows delayed exection of ActiveRecord instance methods' do
- skip('requires a database')
- end
-
class UserMailer < ActionMailer::Base
def greetings(a, b)
raise "Should not be called!"
View
@@ -52,13 +52,17 @@ def @redis.with; yield self; end
@redis = MiniTest::Mock.new
Sidekiq.instance_variable_set(:@redis, @redis)
+ fake_msg = MultiJson.encode({ 'class' => 'Bob', 'args' => [1,2], 'queue' => 'someq' })
+
def @redis.with; yield self; end
- @redis.expect :zremrangebyscore, [], ['retry', '-inf', String]
+ @redis.expect :zremrangebyscore, [fake_msg], ['retry', '-inf', String]
+ @redis.expect :rpush, 1, ['someq', fake_msg]
end
it 'should poll like a bad mother...SHUT YO MOUTH' do
inst = Sidekiq::Retry::Poller.new
inst.poll
+ @redis.verify
end
end

0 comments on commit b782c05

Please sign in to comment.