Skip to content

Commit

Permalink
Fixed focused tests for hydra-core
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Feb 6, 2013
1 parent 4936a8d commit 871801c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
6 changes: 6 additions & 0 deletions HISTORY.textile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
h3. 5.4.0
* Hydra::Ability should use a separate cache for each permission document
* Fixed bug with policy access enforcement which occurs when you select a facet.
* Fixed logging typo
* Hydra::User now has a groups method. Use this instead of RoleMapper.

h3. 5.3.0
* add Hydra::ModelMethods.add_file
* Don't generate solr_mappings.yml by default
Expand Down
2 changes: 1 addition & 1 deletion HYDRA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.3.0
5.4.0
33 changes: 17 additions & 16 deletions hydra-core/tasks/rspec.rake
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
ENV["RAILS_ROOT"] ||= 'spec/internal'

GEM_ROOT= File.expand_path(File.join(File.dirname(__FILE__),".."))

desc "Run specs"
task :spec => [:generate, :fixtures] do |t|
Bundler.with_clean_env do
within_test_app do
system "rake myspec"
abort "Error running hydra-core" unless $?.success?
end
focused_spec = ENV['SPEC'] ? " SPEC=#{File.join(GEM_ROOT, ENV['SPEC'])}" : ''
within_test_app do
system "rake myspec#{focused_spec}"
abort "Error running hydra-core" unless $?.success?
end
end

Expand All @@ -26,16 +27,14 @@ task :generate do
`cp spec/support/Gemfile spec/internal`
puts "Copying generator"
`cp -r spec/support/lib/generators spec/internal/lib`
Bundler.with_clean_env do
within_test_app do
puts "Bundle install"
`bundle install`
puts "running test_app_generator"
system "rails generate test_app"

puts "running migrations"
puts `rake db:migrate db:test:prepare`
end
within_test_app do
puts "Bundle install"
`bundle install`
puts "running test_app_generator"
system "rails generate test_app"

puts "running migrations"
puts `rake db:migrate db:test:prepare`
end
end
puts "Running specs"
Expand All @@ -49,6 +48,8 @@ end

def within_test_app
FileUtils.cd('spec/internal')
yield
Bundler.with_clean_env do
yield
end
FileUtils.cd('../..')
end

0 comments on commit 871801c

Please sign in to comment.