Skip to content
Browse files

add bundler to the mix, make test/asset_package_helper_development_te…

…st.rb run without rails environment
  • Loading branch information...
1 parent d1fb124 commit a83b511114e8618c83d93ec95527ab3776c00860 @grosser grosser committed with marcroberts Aug 19, 2010
Showing with 60 additions and 12 deletions.
  1. +6 −0 Gemfile
  2. +33 −0 Gemfile.lock
  3. +4 −11 test/asset_package_helper_development_test.rb
  4. +17 −1 test/test_helper.rb
View
6 Gemfile
@@ -0,0 +1,6 @@
+source 'http://rubygems.org'
+
+gem 'actionpack', '2.3.8', :require => 'action_pack'
+gem 'rails', '2.3.8'
+gem 'rack'
+gem 'mocha'
View
33 Gemfile.lock
@@ -0,0 +1,33 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (2.3.8)
+ actionpack (= 2.3.8)
+ actionpack (2.3.8)
+ activesupport (= 2.3.8)
+ rack (~> 1.1.0)
+ activerecord (2.3.8)
+ activesupport (= 2.3.8)
+ activeresource (2.3.8)
+ activesupport (= 2.3.8)
+ activesupport (2.3.8)
+ mocha (0.9.8)
+ rake
+ rack (1.1.0)
+ rails (2.3.8)
+ actionmailer (= 2.3.8)
+ actionpack (= 2.3.8)
+ activerecord (= 2.3.8)
+ activeresource (= 2.3.8)
+ activesupport (= 2.3.8)
+ rake (>= 0.8.3)
+ rake (0.8.7)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (= 2.3.8)
+ mocha
+ rack
+ rails (= 2.3.8)
View
15 test/asset_package_helper_development_test.rb
@@ -1,13 +1,6 @@
-$:.unshift(File.dirname(__FILE__) + '/../lib')
-
-ENV['RAILS_ENV'] = "development"
-require File.dirname(__FILE__) + '/../../../../config/environment'
-require 'test/unit'
-require 'rubygems'
-require 'mocha'
-
-require 'action_controller/test_process'
+require 'test/test_helper'
+Rails.env = 'development'
ActionController::Base.logger = nil
ActionController::Routing::Routes.reload rescue nil
@@ -19,8 +12,8 @@ class AssetPackageHelperDevelopmentTest < Test::Unit::TestCase
include Synthesis::AssetPackageHelper
def setup
- Synthesis::AssetPackage.asset_base_path = "#{Rails.root}/vendor/plugins/asset_packager/test/assets"
- Synthesis::AssetPackage.asset_packages_yml = YAML.load_file("#{Rails.root}/vendor/plugins/asset_packager/test/asset_packages.yml")
+ Synthesis::AssetPackage.asset_base_path = "test/assets"
+ Synthesis::AssetPackage.asset_packages_yml = YAML.load_file("test/asset_packages.yml")
Synthesis::AssetPackage.any_instance.stubs(:log)
View
18 test/test_helper.rb
@@ -3,16 +3,32 @@
`rm -rf test/fake_root`
`mkdir -p test/fake_root/tmp`
-class Rails
+module Rails
def self.root
File.expand_path("test/fake_root")
end
+
+ def self.backtrace_cleaner
+ ActiveSupport::BacktraceCleaner.new
+ end
+
+ def self.env=(x)
+ @env = x
+ end
+
+ def self.env
+ @env
+ end
end
+require 'rack'
require 'action_view'
+require 'action_controller'
+require 'rails/backtrace_cleaner'
$LOAD_PATH << 'lib'
require 'init'
require 'test/unit'
+require 'action_controller/test_process'
require 'mocha'

0 comments on commit a83b511

Please sign in to comment.
Something went wrong with that request. Please try again.