Permalink
Browse files

Simplify Rakefile to no longer try and automatically start and stop R…

…edis when running the specs
  • Loading branch information...
David Czarnecki
David Czarnecki committed Aug 28, 2012
1 parent efaa196 commit 711051141dc32d332321661f78b37dab7b3f4464
Showing with 3 additions and 47 deletions.
  1. +3 −39 Rakefile
  2. 0 spec/db/.gitkeep
  3. +0 −8 spec/test.conf
View
@@ -1,6 +1,5 @@
-require 'bundler'
-Bundler::GemHelper.install_tasks
-
+require 'bundler/gem_tasks'
+require 'rake'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
@@ -9,43 +8,8 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
# spec.ruby_opts = ['-w']
end
-REDIS_DIR = File.expand_path(File.join("..", "spec"), __FILE__)
-REDIS_CNF = File.join(REDIS_DIR, "test.conf")
-REDIS_PID = File.join(REDIS_DIR, "db", "redis.pid")
-REDIS_LOCATION = ENV['REDIS_LOCATION']
-
-task :default => :run
-
-desc "Run tests and manage server start/stop"
-task :run => [:start, :spec, :stop]
-
-desc "Start the Redis server"
-task :start do
- redis_running = \
- begin
- File.exists?(REDIS_PID) && Process.kill(0, File.read(REDIS_PID).to_i)
- rescue Errno::ESRCH
- FileUtils.rm REDIS_PID
- false
- end
-
- if REDIS_LOCATION
- system "#{REDIS_LOCATION}/redis-server #{REDIS_CNF}" unless redis_running
- else
- system "redis-server #{REDIS_CNF}" unless redis_running
- end
-end
-
-desc "Stop the Redis server"
-task :stop do
- if File.exists?(REDIS_PID)
- Process.kill "INT", File.read(REDIS_PID).to_i
- FileUtils.rm REDIS_PID
- end
-end
+task :default => :spec
task :test_rubies do
- Rake::Task['start'].execute
system "rvm 1.8.7@leaderboard_gem,1.9.2@leaderboard_gem,1.9.3@leaderboard_gem do rake spec"
- Rake::Task['stop'].execute
end
View
No changes.
View
@@ -1,8 +0,0 @@
-dir ./spec/db
-pidfile ./redis.pid
-port 6379
-timeout 300
-loglevel debug
-logfile stdout
-databases 16
-daemonize yes

0 comments on commit 7110511

Please sign in to comment.