Skip to content

Commit

Permalink
Use bundled env for tests only
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy committed Oct 20, 2009
1 parent c9cd10c commit 2767036
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
6 changes: 2 additions & 4 deletions activerecord/Gemfile
Expand Up @@ -3,8 +3,6 @@ sibling = "#{File.dirname(__FILE__)}/.."

gem "activesupport", "3.0.pre", :vendored_at => "#{sibling}/activesupport"
gem "activemodel", "3.0.pre", :vendored_at => "#{sibling}/activemodel"
gem "arel", :git => "git://github.com/rails/arel.git", :branch => 'master'
gem "arel", :git => "git://github.com/rails/arel.git"

only :test do
gem "mocha"
end
gem "mocha"
13 changes: 4 additions & 9 deletions activerecord/lib/active_record.rb
Expand Up @@ -21,16 +21,11 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#++

bundled = "#{File.dirname(__FILE__)}/../vendor/gems/environment"
if File.exist?("#{bundled}.rb")
require bundled
else
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
$:.unshift(activesupport_path) if File.directory?(activesupport_path)
activesupport_path = "#{File.dirname(__FILE__)}/../../activesupport/lib"
$:.unshift(activesupport_path) if File.directory?(activesupport_path)

activemodel_path = "#{File.dirname(__FILE__)}/../../activemodel/lib"
$:.unshift(activemodel_path) if File.directory?(activemodel_path)
end
activemodel_path = "#{File.dirname(__FILE__)}/../../activemodel/lib"
$:.unshift(activemodel_path) if File.directory?(activemodel_path)

require 'active_support'
require 'active_model'
Expand Down
8 changes: 7 additions & 1 deletion activerecord/test/cases/helper.rb
@@ -1,5 +1,11 @@
$:.unshift(File.dirname(__FILE__) + '/../../lib')
$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')

bundled = "#{File.dirname(__FILE__)}/../../vendor/gems/environment"
if File.exist?("#{bundled}.rb")
require bundled
else
$:.unshift(File.dirname(__FILE__) + '/../../../activesupport/lib')
end

require 'config'

Expand Down

0 comments on commit 2767036

Please sign in to comment.