From 8ce088e718cd37f135876fc4d1c9a7f6fabe11d8 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 18 Mar 2014 10:21:10 -0500 Subject: [PATCH 1/3] Run tests the engine_cart 0.3 way --- Gemfile | 2 ++ .../lib/generators/test_app_generator.rb | 4 ---- .../lib/tasks/blacklight_test_app.rake | 14 -------------- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 spec/test_app_templates/lib/tasks/blacklight_test_app.rake diff --git a/Gemfile b/Gemfile index 333c458..2191bb8 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,8 @@ group :test do gem 'turbolinks' end +gem 'sass-rails' + if File.exists?('spec/test_app_templates/Gemfile.extra') eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra' end diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 4614ac7..58f2fac 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -3,10 +3,6 @@ class TestAppGenerator < Rails::Generators::Base source_root File.expand_path("../../../../test_app_templates", __FILE__) - def copy_blacklight_test_app_rake_task - copy_file "lib/tasks/blacklight_test_app.rake" - end - def run_blacklight_generator say_status("warning", "GENERATING BL", :yellow) diff --git a/spec/test_app_templates/lib/tasks/blacklight_test_app.rake b/spec/test_app_templates/lib/tasks/blacklight_test_app.rake deleted file mode 100644 index ab69cf8..0000000 --- a/spec/test_app_templates/lib/tasks/blacklight_test_app.rake +++ /dev/null @@ -1,14 +0,0 @@ -require 'rspec/core/rake_task' - -desc "run the blacklight gem spec" -gem_home = File.expand_path('../../../../..', __FILE__) - -namespace :blacklight_test_app do - - RSpec::Core::RakeTask.new(:spec) do |t| - t.pattern = gem_home + '/spec/**/*_spec.rb' - t.rspec_opts = "--colour" - t.ruby_opts = "-I#{gem_home}/spec" - end - -end From 7e102d8bc336009265f357a51e5e81a6abbf725a Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 18 Mar 2014 10:34:57 -0500 Subject: [PATCH 2/3] Remove public/index.html when testing --- spec/test_app_templates/lib/generators/test_app_generator.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/test_app_templates/lib/generators/test_app_generator.rb b/spec/test_app_templates/lib/generators/test_app_generator.rb index 58f2fac..0c7ad78 100644 --- a/spec/test_app_templates/lib/generators/test_app_generator.rb +++ b/spec/test_app_templates/lib/generators/test_app_generator.rb @@ -3,6 +3,11 @@ class TestAppGenerator < Rails::Generators::Base source_root File.expand_path("../../../../test_app_templates", __FILE__) + # This is only necessary for Rails 3 + def remove_index + remove_file "public/index.html" + end + def run_blacklight_generator say_status("warning", "GENERATING BL", :yellow) From 3f8cdcdca789d36ca7b4214598c7493978c3a845 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 18 Mar 2014 11:28:39 -0500 Subject: [PATCH 3/3] Peg version of sprockets and sass for testing --- Gemfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Gemfile b/Gemfile index 2191bb8..bd86768 100644 --- a/Gemfile +++ b/Gemfile @@ -12,6 +12,15 @@ group :test do end gem 'sass-rails' +# If we don't specify 2.11.0 we'll end up with sprockets 2.12.0 in the main +# Gemfile.lock but since sass-rails gets generated (rails new) into the test app +# it'll want sprockets 2.11.0 and we'll have a conflict +gem 'sprockets', '2.11.0' + +# If we don't specify 3.2.15 we'll end up with sass 3.3.2 in the main +# Gemfile.lock but since sass-rails gets generated (rails new) into the test app +# it'll want sass 3.2.0 and we'll have a conflict +gem 'sass', '~> 3.2.0' if File.exists?('spec/test_app_templates/Gemfile.extra') eval File.read('spec/test_app_templates/Gemfile.extra'), nil, 'spec/test_app_templates/Gemfile.extra'