diff options
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/initializer_test.rb | 7 | ||||
-rw-r--r-- | railties/test/plugin_loader_test.rb | 9 | ||||
-rw-r--r-- | railties/test/rails_generator_test.rb | 2 | ||||
-rw-r--r-- | railties/test/secret_key_generation_test.rb | 9 |
4 files changed, 25 insertions, 2 deletions
diff --git a/railties/test/initializer_test.rb b/railties/test/initializer_test.rb index 3a49b2ddb4..0df0164ca6 100644 --- a/railties/test/initializer_test.rb +++ b/railties/test/initializer_test.rb @@ -1,6 +1,13 @@ require 'abstract_unit' require 'initializer' +# Mocks out the configuration +module Rails + def self.configuration + Rails::Configuration.new + end +end + class ConfigurationMock < Rails::Configuration attr_reader :environment_path diff --git a/railties/test/plugin_loader_test.rb b/railties/test/plugin_loader_test.rb index 30eeaadf12..30fcacbaa1 100644 --- a/railties/test/plugin_loader_test.rb +++ b/railties/test/plugin_loader_test.rb @@ -1,5 +1,12 @@ require 'plugin_test_helper' +# Mocks out the configuration +module Rails + def self.configuration + Rails::Configuration.new + end +end + uses_mocha "Plugin Loader Tests" do class TestPluginLoader < Test::Unit::TestCase @@ -41,7 +48,7 @@ uses_mocha "Plugin Loader Tests" do end def test_should_find_all_availble_plugins_and_return_as_all_plugins - assert_plugins [:a, :acts_as_chunky_bacon, :plugin_with_no_lib_dir, :stubby], @loader.all_plugins, @failure_tip + assert_plugins [:a, :acts_as_chunky_bacon, :plugin_with_no_lib_dir, :stubby], @loader.all_plugins.reverse, @failure_tip end def test_should_return_all_plugins_as_plugins_when_registered_plugin_list_is_untouched diff --git a/railties/test/rails_generator_test.rb b/railties/test/rails_generator_test.rb index 63dd501614..e1445e0a20 100644 --- a/railties/test/rails_generator_test.rb +++ b/railties/test/rails_generator_test.rb @@ -74,7 +74,7 @@ class RailsGeneratorTest < Test::Unit::TestCase def test_lookup_missing_generator assert_raise Rails::Generator::GeneratorError do - Rails::Generator::Base.lookup('missing_generator').klass + Rails::Generator::Base.lookup('missing').klass end end diff --git a/railties/test/secret_key_generation_test.rb b/railties/test/secret_key_generation_test.rb index 093436889c..ea1b0dae31 100644 --- a/railties/test/secret_key_generation_test.rb +++ b/railties/test/secret_key_generation_test.rb @@ -9,6 +9,15 @@ end $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" +require 'initializer' + +# Mocks out the configuration +module Rails + def self.configuration + Rails::Configuration.new + end +end + require 'rails_generator' require 'rails_generator/secret_key_generator' require 'rails_generator/generators/applications/app/app_generator' |