Sha256: c6c53907d4eb75ba8fec1be1332baed751ac0cc98e94db1b15f780c630973faa

Contents?: true

Size: 843 Bytes

Versions: 5

Compression:

Stored size: 843 Bytes

Contents

$:.unshift File.dirname(__FILE__) + "/../lib"
$:.unshift File.dirname(__FILE__) + "/../../activesupport/lib"

require 'test/unit'
require 'active_support'
require 'initializer'

class InitializerTest < Test::Unit::TestCase
  class ConfigurationMock < Rails::Configuration
    def initialize(envpath)
      super()
      @envpath = envpath
    end
    
    def environment_path
      @envpath
    end

    protected
      def root_path
        File.dirname(__FILE__)
      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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiant-0.6.1 vendor/rails/railties/test/initializer_test.rb
radiant-0.6.0 vendor/rails/railties/test/initializer_test.rb
radiant-0.6.2 vendor/rails/railties/test/initializer_test.rb
radiant-0.6.3 vendor/rails/railties/test/initializer_test.rb
radiant-0.6.4 vendor/rails/railties/test/initializer_test.rb