aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-09-22 17:08:09 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-09-22 17:08:09 +0000
commita5af3f75af86ff0abd9964bfd69483d116c12b13 (patch)
tree5e16778559fce11a84117e6fe38e6e2b4bb0a572 /railties/test
parente38ad5ddcc1de38ff485d3d78d9c72283320cdaf (diff)
downloadrails-a5af3f75af86ff0abd9964bfd69483d116c12b13.tar.gz
rails-a5af3f75af86ff0abd9964bfd69483d116c12b13.tar.bz2
rails-a5af3f75af86ff0abd9964bfd69483d116c12b13.zip
Added symbols as a legal way of specifying plugins in config.plugins (closes #9629) [tom]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7540 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/plugin_locator_test.rb20
1 files changed, 13 insertions, 7 deletions
diff --git a/railties/test/plugin_locator_test.rb b/railties/test/plugin_locator_test.rb
index cf6c0d9507..3ac4493d47 100644
--- a/railties/test/plugin_locator_test.rb
+++ b/railties/test/plugin_locator_test.rb
@@ -16,33 +16,39 @@ class TestPluginFileSystemLocator < Test::Unit::TestCase
end
def test_only_the_specified_plugins_are_located_in_the_order_listed
- plugin_names = %w(stubby acts_as_chunky_bacon)
+ plugin_names = [:stubby, :acts_as_chunky_bacon]
only_load_the_following_plugins! plugin_names
assert_equal plugin_names, @locator.plugin_names
end
def test_all_plugins_are_loaded_when_registered_plugin_list_is_untouched
failure_tip = "It's likely someone has added a new plugin fixture without updating this list"
- assert_equal %w(a acts_as_chunky_bacon plugin_with_no_lib_dir stubby), @locator.plugin_names, failure_tip
+ assert_equal [:a, :acts_as_chunky_bacon, :plugin_with_no_lib_dir, :stubby], @locator.plugin_names, failure_tip
end
def test_all_plugins_loaded_when_all_is_used
- plugin_names = ['stubby', 'acts_as_chunky_bacon', :all]
+ plugin_names = [:stubby, :acts_as_chunky_bacon, :all]
only_load_the_following_plugins! plugin_names
failure_tip = "It's likely someone has added a new plugin fixture without updating this list"
- assert_equal %w(stubby acts_as_chunky_bacon a plugin_with_no_lib_dir), @locator.plugin_names, failure_tip
+ assert_equal [:stubby, :acts_as_chunky_bacon, :a, :plugin_with_no_lib_dir], @locator.plugin_names, failure_tip
end
def test_all_plugins_loaded_after_all
- plugin_names = ['stubby', :all, 'acts_as_chunky_bacon']
+ plugin_names = [:stubby, :all, :acts_as_chunky_bacon]
only_load_the_following_plugins! plugin_names
failure_tip = "It's likely someone has added a new plugin fixture without updating this list"
- assert_equal %w(stubby a plugin_with_no_lib_dir acts_as_chunky_bacon ), @locator.plugin_names, failure_tip
+ assert_equal [:stubby, :a, :plugin_with_no_lib_dir, :acts_as_chunky_bacon], @locator.plugin_names, failure_tip
end
+ def test_plugin_names_may_be_strings
+ plugin_names = ['stubby', 'acts_as_chunky_bacon', :a, :plugin_with_no_lib_dir]
+ only_load_the_following_plugins! plugin_names
+ failure_tip = "It's likely someone has added a new plugin fixture without updating this list"
+ assert_equal [:stubby, :acts_as_chunky_bacon, :a, :plugin_with_no_lib_dir], @locator.plugin_names, failure_tip
+ end
def test_registering_a_plugin_name_that_does_not_exist_raises_a_load_error
- only_load_the_following_plugins! %w(stubby acts_as_a_non_existant_plugin)
+ only_load_the_following_plugins! [:stubby, :acts_as_a_non_existant_plugin]
assert_raises(LoadError) do
@initializer.load_plugins
end