Skip to content

Commit

Permalink
Make sure orm adapters are loaded (these are loaded in devise, but th…
Browse files Browse the repository at this point in the history
…ere are issues with the test_helpers conflicting. There may be a better solution here...)
  • Loading branch information
cheerfulstoic authored and andreasronge committed Jul 8, 2014
1 parent 8c96467 commit 39b67af
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 22 deletions.
11 changes: 7 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ 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
puts ENV['DEVISE_PATH']
desc 'Run tests for devise-neo4j.'
Rake::TestTask.new(:test) do |test|
unless File.exist?(ENV['DEVISE_PATH'])
Expand All @@ -21,8 +20,12 @@ Rake::TestTask.new(:test) do |test|
test.libs << 'test'
test.libs << "#{ENV['DEVISE_PATH']}/lib"
test.libs << "#{ENV['DEVISE_PATH']}/test"

test.test_files = FileList["#{ENV['DEVISE_PATH']}/test/**/*_test.rb"] + FileList['test/**/*_test.rb']

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

Expand All @@ -34,4 +37,4 @@ namespace :neo4j do
system "rm -fr #{File.join(File.dirname(__FILE__), "db", "*")}"
end
end
end
end
2 changes: 1 addition & 1 deletion devise-neo4j.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ Gem::Specification.new do |s|
s.add_dependency("orm_adapter", "~> 0.5.0")
s.add_dependency("bcrypt-ruby", "~> 3.0")
s.add_dependency("railties", ">= 3.1")
s.add_dependency("neo4j", ">= 2.2.0")
s.add_dependency("neo4j", ">= 3.0.0.alpha.6")
s.add_dependency("devise", "~> 3.0")
end
17 changes: 0 additions & 17 deletions test/overrides/rememberable_test.rb

This file was deleted.

1 change: 1 addition & 0 deletions test/rails_app/app/neo4j/admin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ class Admin

end

AdminAdapter = Admin.to_adapter unless Admin.is_a?(OrmAdapter::Base)

3 changes: 3 additions & 0 deletions test/rails_app/app/neo4j/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@ class User
property :updated_at, type: DateTime

end

UserAdapter = User.to_adapter unless User.is_a?(OrmAdapter::Base)

0 comments on commit 39b67af

Please sign in to comment.