mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
29d63a04ac
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6488 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
22 lines
653 B
Ruby
22 lines
653 B
Ruby
require "#{File.dirname(__FILE__)}/abstract_unit"
|
|
require 'initializer'
|
|
|
|
class InitializerTest < Test::Unit::TestCase
|
|
class ConfigurationMock < Rails::Configuration
|
|
attr_reader :environment_path
|
|
|
|
def initialize(envpath)
|
|
super()
|
|
@environment_path = envpath
|
|
end
|
|
end
|
|
|
|
def test_load_environment_with_constant
|
|
config = ConfigurationMock.new("#{File.dirname(__FILE__)}/fixtures/environment_with_constant.rb")
|
|
assert_nil $initialize_test_set_from_env
|
|
Rails::Initializer.run(:load_environment, config)
|
|
assert_equal "success", $initialize_test_set_from_env
|
|
ensure
|
|
$initialize_test_set_from_env = nil
|
|
end
|
|
end
|