Sha256: 4f2c0d35fa1bb595904ec9a20304fb39a4ad05e160ca1e14ce8ee7fc3c820ad1
Contents?: true
Size: 1.8 KB
Versions: 5
Compression:
Stored size: 1.8 KB
Contents
require "bundler/gem_tasks" ZIP_URL = "https://github.com/projectblacklight/blacklight-jetty/archive/v4.0.0.zip" APP_ROOT = File.expand_path("..", __FILE__) TEST_APP_TEMPLATES = 'spec/test_app_templates' TEST_APP = 'spec/internal' require 'jettywrapper' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) task :default => [:ci] task :ci => ['blacklight_marc:generate', 'jetty:clean'] do ENV['environment'] = "test" jetty_params = Jettywrapper.load_config jetty_params[:startup_wait]= 60 error = Jettywrapper.wrap(jetty_params) do Rake::Task["blacklight_marc:fixtures"].invoke Rake::Task['spec'].invoke end raise "test failures: #{error}" if error end namespace :blacklight_marc do desc "Load fixtures" task :fixtures => [:generate] do within_test_app do system "rake solr:marc:index_test_data RAILS_ENV=test" abort "Error running fixtures" unless $?.success? end end desc "Create the test rails app" task :generate do unless File.exists?('spec/internal/Rakefile') puts "Generating rails app" `rails new #{TEST_APP}` puts "Copying gemfile" open("#{TEST_APP}/Gemfile", 'a') do |f| f.write File.read(TEST_APP_TEMPLATES + "/Gemfile.extra") f.write "gem 'blacklight_marc', :path => '../../'" end puts "Copying generator" `cp -r #{TEST_APP_TEMPLATES}/lib/generators #{TEST_APP}/lib` 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 "Done generating test app" end end def within_test_app FileUtils.cd(TEST_APP) Bundler.with_clean_env do yield end FileUtils.cd(APP_ROOT) end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
blacklight_marc-0.0.9 | Rakefile |
blacklight_marc-0.0.8 | Rakefile |
blacklight_marc-0.0.7 | Rakefile |
blacklight_marc-0.0.6 | Rakefile |
blacklight_marc-0.0.5 | Rakefile |