Permalink
Browse files

RSpec passes all specs.

  • Loading branch information...
1 parent b0a1771 commit 8ae3041593f14dc946a814f4e47bcc02ab51e865 shock committed Mar 26, 2014
Showing with 20 additions and 13 deletions.
  1. +3 −0 .gitignore
  2. +6 −2 Gemfile
  3. +3 −3 Rakefile
  4. +2 −2 spec/spec_helper.rb
  5. BIN test/dump.rdb
  6. +1 −1 test/test_helper.rb
  7. +5 −5 test/worker_test.rb
View
@@ -7,3 +7,6 @@ spec/stdout
coverage/
.ruby-version
.ruby-gemset
+bin/
+test/dump.rdb
+.bundle
View
@@ -3,5 +3,9 @@ source 'http://rubygems.org'
gemspec
-gem 'debugger', group: :development, platform: :mri_19
-gem 'codeclimate-test-reporter', group: :test, require: nil
+gem 'rake', '~> 0.8.7'
+gem 'rainbow', '~> 1.99.2'
+gem 'rubocop', '~> 0.5.0'
+gem 'json'
+gem 'debugger', :group => :development, :platform => :mri_19
+gem 'codeclimate-test-reporter', :group => :test, :require => nil
View
@@ -9,15 +9,15 @@ load 'tasks/redis.rake'
require 'rake/testtask'
require 'resque/tasks'
require 'bundler/gem_tasks'
-require 'rubocop/rake_task'
+# require 'rubocop/rake_task'
def command?(command)
system("type #{command} > /dev/null 2>&1")
end
-task default: [:rubocop, :spec]
+task :default => [:spec]
-Rubocop::RakeTask.new
+# Rubocop::RakeTask.new
desc 'Run specs for resque-loner'
RSpec::Core::RakeTask.new(:spec) do |t|
View
@@ -1,8 +1,8 @@
require 'rubygems'
require 'bundler/setup'
-require 'codeclimate-test-reporter'
-CodeClimate::TestReporter.start
+# require 'codeclimate-test-reporter'
+# CodeClimate::TestReporter.start
require 'English'
require 'simplecov'
View
Binary file not shown.
View
@@ -53,7 +53,7 @@
`redis-server #{$dir}/redis-test.conf`
`redis-server #{$dir}/redis-test-cluster.conf`
r = Redis::Distributed.new(['redis://localhost:9736', 'redis://localhost:9737'])
- Resque.redis = Redis::Namespace.new :resque, redis: r
+ Resque.redis = Redis::Namespace.new :resque, :redis => r
else
puts 'Starting redis for testing at localhost:9736...'
`redis-server #{$dir}/redis-test.conf`
View
@@ -414,8 +414,8 @@ def self.perform
test 'requeue failed queue' do
queue = 'good_job'
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, payload: { 'class' => 'GoodJob' })
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), queue: 'some_job', payload: { 'class' => 'SomeJob' })
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => { 'class' => 'GoodJob' })
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => 'some_job', :payload => { 'class' => 'SomeJob' })
Resque::Failure.requeue_queue(queue)
assert Resque::Failure.all(0).key?('retried_at')
assert !Resque::Failure.all(1).key?('retried_at')
@@ -424,9 +424,9 @@ def self.perform
test 'remove failed queue' do
queue = 'good_job'
queue2 = 'some_job'
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, payload: { 'class' => 'GoodJob' })
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue2), :queue => queue2, payload: { 'class' => 'SomeJob' })
- Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, payload: { 'class' => 'GoodJob' })
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => { 'class' => 'GoodJob' })
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue2), :queue => queue2, :payload => { 'class' => 'SomeJob' })
+ Resque::Failure.create(:exception => Exception.new, :worker => Resque::Worker.new(queue), :queue => queue, :payload => { 'class' => 'GoodJob' })
Resque::Failure.remove_queue(queue)
assert_equal queue2, Resque::Failure.all(0)['queue']
assert_equal 1, Resque::Failure.count

0 comments on commit 8ae3041

Please sign in to comment.