Sha256: c65b98696a939cd66a22d24ccae0e9a79cb2ce1dfbb433df892ec241ecbe278a

Contents?: true

Size: 730 Bytes

Versions: 5

Compression:

Stored size: 730 Bytes

Contents

require "rake/testtask"
require "appraisal"
require "bundler/setup"

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)}"
    File.delete(REDIS_PID)
  end
end

Rake::TestTask.new do |t|
  t.libs << "test"
  t.test_files = FileList['test/*_test.rb']
  t.verbose = true
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ohm-sorted-0.3.1 Rakefile
ohm-sorted-0.3.0 Rakefile
ohm-sorted-0.2.1 Rakefile
ohm-sorted-0.2.0 Rakefile
ohm-sorted-0.1.0 Rakefile