Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 40 lines (34 sloc) 1.242 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
# encoding: UTF-8
require "bundler/gem_tasks"
require 'rake/testtask'
require 'rdoc/task'
require 'neo4j/tasks/neo4j_server'


task :default => [:test, :"neo4j:db:remove"]

ENV['DEVISE_ORM'] = 'neo4j'
devise_checked_out = File.join(File.dirname(__FILE__), '../devise')
ENV['DEVISE_PATH'] = File.exist?(devise_checked_out) ? devise_checked_out : `bundle show devise`.chomp
desc 'Run tests for devise-neo4j.'
Rake::TestTask.new(:test) do |test|
  unless File.exist?(ENV['DEVISE_PATH'])
    puts "Specify the path to devise (e.g. rake DEVISE_PATH=/path/to/devise) or include it in your gem bundle. Not found at #{ENV['DEVISE_PATH']}"
    exit
  end
  test.libs << 'lib'
  test.libs << 'test'
  test.libs << "#{ENV['DEVISE_PATH']}/lib"
  test.libs << "#{ENV['DEVISE_PATH']}/test"

  if devise_test_path = ENV['DEVISE_TEST_PATH']
    test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/#{devise_test_path}"]
  else
    test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + FileList['test/**/*_test.rb']
  end
  test.verbose = true
end


namespace :neo4j do
  namespace :db do
    desc 'Remove the neo4j db files'
    task :remove do
      system "rm -fr #{File.join(File.dirname(__FILE__), "db", "*")}"
    end
  end
end
Something went wrong with that request. Please try again.