Skip to content

Commit

Permalink
make sure Trinidad's Gemfile is used for the spec rails app
Browse files Browse the repository at this point in the history
also make sure Rails.root points to correct dir when run as a spec
  • Loading branch information
kares committed Oct 17, 2012
1 parent 5fb7e0a commit 63dc9fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion spec/web_app_rails/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -61,4 +64,4 @@ class Application < Rails::Application
config.assets.version = '1.0'

end
end
end
5 changes: 4 additions & 1 deletion spec/web_app_rails/config/boot.rb
Original file line number Diff line number Diff line change
@@ -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'])

0 comments on commit 63dc9fe

Please sign in to comment.