Skip to content

Commit

Permalink
Updating tests and syncing with bundler defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansch committed Nov 8, 2011
1 parent 53cc3d6 commit d12b413
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 20 deletions.
2 changes: 2 additions & 0 deletions Rakefile
Expand Up @@ -15,6 +15,8 @@ require 'rake/testtask'

require 'resque/tasks'

require 'bundler/gem_tasks'

def command?(command)
system("type #{command} > /dev/null 2>&1")
end
Expand Down
11 changes: 7 additions & 4 deletions resque-loner.gemspec
Expand Up @@ -18,16 +18,19 @@ Gem::Specification.new do |s|

s.add_dependency 'resque', '~>1.0'
{
'bundler' => '~> 1.0.0',
'rake' => '~> 0.8.7',
'rake' => '> 0.8.7',
'rack-test' => '~> 0.5.7',
'rspec' => '~> 2.5.0',
'mock_redis' => '~> 0.2.0',
'yajl-ruby' => '~> 0.8.2'
}.each do |lib, version|
s.add_development_dependency lib, version
end

s.files = Dir.glob("{lib}/**/*") + %w(README.markdown)
s.require_path = 'lib'
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ["lib"]

s.description = <<desc
Makes sure that for special jobs, there can be only one job with the same workload in one queue.
Expand Down
18 changes: 2 additions & 16 deletions spec/spec_helper.rb
Expand Up @@ -3,26 +3,12 @@
require 'rspec'

require 'ruby-debug'
require 'mock_redis'
require 'resque'
require 'resque-loner'

RSpec.configure do |config|
config.before(:suite) do
if !system("which redis-server")
puts '', "** can't find `redis-server` in your path"
puts "** try running `sudo rake install`"
abort ''
end
puts "Starting redis for testing at localhost:9736..."
`redis-server #{File.dirname(File.expand_path(__FILE__))}/redis-test.conf`
puts "redis-server #{File.dirname(File.expand_path(__FILE__))}/redis-test.conf"
Resque.redis = 'localhost:9736'
end

config.after(:suite) do
pid = `ps -e -o pid,command | grep [r]edis-test`.split(" ")[0]
puts "Killing test redis server #{pid}..."
`rm -f #{File.dirname(File.expand_path(__FILE__))}/dump.rdb`
Process.kill("KILL", pid.to_i)
Resque.redis = MockRedis.new
end
end

0 comments on commit d12b413

Please sign in to comment.