Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pulled in current resque testsuite and bumped version to 1.0, as we'v…

…e been using resque-loner in production for quite a while
  • Loading branch information...
commit b6f60d23ca41feaf85cedfa73c6baeb494a37cd7 1 parent 1f76e5f
@jayniz jayniz authored
View
44 Rakefile
@@ -2,6 +2,8 @@
# Setup
#
+$LOAD_PATH.unshift 'lib'
+
require "rubygems"
require "bundler"
Bundler.setup
@@ -11,7 +13,6 @@ require 'rspec/core/rake_task'
load 'tasks/redis.rake'
require 'rake/testtask'
-$LOAD_PATH.unshift 'lib'
require 'resque/tasks'
def command?(command)
@@ -31,11 +32,25 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w(-fd -c)
end
-desc "Run resque's test suite to make sure we did not break anything"
-task :test do
- rg = command?(:rg)
- Dir['test/**/*_test.rb'].each do |f|
- rg ? sh("rg #{f}") : ruby(f)
+# desc "Run resque's test suite to make sure we did not break anything"
+# task :test do
+# rg = command?(:rg)
+# Dir['test/**/*_test.rb'].each do |f|
+# rg ? sh("rg #{f}") : ruby(f)
+# end
+# end
+
+if command?(:rg)
+ desc "Run the test suite with rg"
+ task :test do
+ Dir['test/**/*_test.rb'].each do |f|
+ sh("rg #{f}")
+ end
+ end
+else
+ Rake::TestTask.new do |test|
+ test.libs << "test"
+ test.test_files = FileList['test/**/*_test.rb']
end
end
@@ -64,20 +79,3 @@ begin
rescue LoadError
end
-
-#
-# Publishing
-#
-
-desc "Push a new version to Gemcutter"
-task :publish do
- require 'resque/version'
-
- sh "gem build resque.gemspec"
- sh "gem push resque-#{Resque::Version}.gem"
- sh "git tag v#{Resque::Version}"
- sh "git push origin v#{Resque::Version}"
- sh "git push origin master"
- sh "git clean -fd"
- exec "rake pages"
-end
View
2  lib/resque-loner/version.rb
@@ -1,7 +1,7 @@
module Resque
module Plugins
module Loner
- VERSION = "0.1.3"
+ VERSION = "1.0"
end
end
end
View
25 test/hoptoad_test.rb
@@ -0,0 +1,25 @@
+require 'test_helper'
+
+begin
+ require 'hoptoad_notifier'
+rescue LoadError
+ warn "Install hoptoad_notifier gem to run Hoptoad tests."
+end
+
+if defined? HoptoadNotifier
+ context "Hoptoad" do
+ test "should be notified of an error" do
+ exception = StandardError.new("BOOM")
+ worker = Resque::Worker.new(:test)
+ queue = "test"
+ payload = {'class' => Object, 'args' => 66}
+
+ HoptoadNotifier.expects(:notify_or_ignore).with(
+ exception,
+ :parameters => {:payload_class => 'Object', :payload_args => '66'})
+
+ backend = Resque::Failure::Hoptoad.new(exception, worker, queue, payload)
+ backend.save
+ end
+ end
+end
View
7 test/test_helper.rb
@@ -1,9 +1,12 @@
+require 'rubygems'
+require 'bundler'
+Bundler.setup(:default, :test)
+Bundler.require(:default, :test)
+
dir = File.dirname(File.expand_path(__FILE__))
$LOAD_PATH.unshift dir + '/../lib'
$TESTING = true
require 'test/unit'
-require 'rubygems'
-require 'resque'
begin
require 'leftright'
Please sign in to comment.
Something went wrong with that request. Please try again.