From 63dc9fe0b6d4e03db3cd0bb747872402edae6dd6 Mon Sep 17 00:00:00 2001 From: kares Date: Wed, 17 Oct 2012 10:14:38 +0200 Subject: [PATCH] make sure Trinidad's Gemfile is used for the spec rails app also make sure Rails.root points to correct dir when run as a spec --- spec/web_app_rails/config/application.rb | 5 ++++- spec/web_app_rails/config/boot.rb | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/web_app_rails/config/application.rb b/spec/web_app_rails/config/application.rb index 91c3b5a..87aedc8 100644 --- a/spec/web_app_rails/config/application.rb +++ b/spec/web_app_rails/config/application.rb @@ -15,6 +15,9 @@ module Rails32 class Application < Rails::Application + # NOTE: set Rails.root as Dir.pwd might be different when under specs : + config.root = File.expand_path('../..', __FILE__) + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. @@ -61,4 +64,4 @@ class Application < Rails::Application config.assets.version = '1.0' end -end +end \ No newline at end of file diff --git a/spec/web_app_rails/config/boot.rb b/spec/web_app_rails/config/boot.rb index 4489e58..c69b020 100644 --- a/spec/web_app_rails/config/boot.rb +++ b/spec/web_app_rails/config/boot.rb @@ -1,6 +1,9 @@ require 'rubygems' # Set up gems listed in the Gemfile. -ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +# ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) +# NOTE: use Trinidad's Gemfile - we'll require the integration group +# @see #application.rb Bundler.require(:integration, Rails.env) +ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__) require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])