Sha256: d6bf002be1fe7e042fe2d3f12651b2b3bfbe41061a7d7799a6167238b2927771

Contents?: true

Size: 739 Bytes

Versions: 4

Compression:

Stored size: 739 Bytes

Contents

require "rake/testtask"

REDIS_DIR = File.expand_path(File.join("..", "test"), __FILE__)
REDIS_CNF = File.join(REDIS_DIR, "test.conf")
REDIS_PID = File.join(REDIS_DIR, "db", "redis.pid")

task :default => :run

desc "Run tests and manage server start/stop"
task :run => [:start, :test, :stop]

desc "Start the Redis server"
task :start do
  unless File.exists?(REDIS_PID)
    system "redis-server #{REDIS_CNF}"
  end
end

desc "Stop the Redis server"
task :stop do
  if File.exists?(REDIS_PID)
    system "kill #{File.read(REDIS_PID)}"
    system "rm #{REDIS_PID}"
  end
end

task :test do
  Dir["test/**/*_test.rb"].each do |file|
    fork do
      load file
    end

    Process.wait

    exit $?.exitstatus unless $?.success?
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ohm-0.0.38 Rakefile
ohm-0.0.37 Rakefile
ohm-0.1.0.rc4 Rakefile
ohm-0.0.36 Rakefile