diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-25 23:17:39 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-25 23:17:39 +0100 |
commit | cc1bb8590e6021e0c86b345857358704fa68c9eb (patch) | |
tree | 1eaacb37a53146aa83b57cc20d7d0791065d621c /railties | |
parent | 02908e11425069e5b91cbf8ec3c8344a58493ef8 (diff) | |
download | rails-cc1bb8590e6021e0c86b345857358704fa68c9eb.tar.gz rails-cc1bb8590e6021e0c86b345857358704fa68c9eb.tar.bz2 rails-cc1bb8590e6021e0c86b345857358704fa68c9eb.zip |
Refactor some railties tests structure.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/railties/configuration_test.rb (renamed from railties/test/plugins/configuration_test.rb) | 2 | ||||
-rw-r--r-- | railties/test/railties/framework_extension_test.rb (renamed from railties/test/plugins/framework_extension_test.rb) | 2 | ||||
-rw-r--r-- | railties/test/railties/plugin_ordering_test.rb | 55 | ||||
-rw-r--r-- | railties/test/railties/plugin_test.rb (renamed from railties/test/plugins/vendored_test.rb) | 56 |
4 files changed, 59 insertions, 56 deletions
diff --git a/railties/test/plugins/configuration_test.rb b/railties/test/railties/configuration_test.rb index c59040c712..c5ff6dad9c 100644 --- a/railties/test/plugins/configuration_test.rb +++ b/railties/test/railties/configuration_test.rb @@ -1,6 +1,6 @@ require "isolation/abstract_unit" -module PluginsTest +module RailtiesTest class ConfigurationTest < Test::Unit::TestCase def setup build_app diff --git a/railties/test/plugins/framework_extension_test.rb b/railties/test/railties/framework_extension_test.rb index d57fd4e635..84bd6ed16b 100644 --- a/railties/test/plugins/framework_extension_test.rb +++ b/railties/test/railties/framework_extension_test.rb @@ -1,6 +1,6 @@ require "isolation/abstract_unit" -module PluginsTest +module RailtiesTest class FrameworkExtensionTest < Test::Unit::TestCase include ActiveSupport::Testing::Isolation diff --git a/railties/test/railties/plugin_ordering_test.rb b/railties/test/railties/plugin_ordering_test.rb new file mode 100644 index 0000000000..a72e59952e --- /dev/null +++ b/railties/test/railties/plugin_ordering_test.rb @@ -0,0 +1,55 @@ +require "isolation/abstract_unit" + +module RailtiesTest + class PluginOrderingTest < Test::Unit::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + $arr = [] + plugin "a_plugin", "$arr << :a" + plugin "b_plugin", "$arr << :b" + plugin "c_plugin", "$arr << :c" + end + + def boot_rails + super + require "#{app_path}/config/environment" + end + + test "plugins are loaded alphabetically by default" do + boot_rails + assert_equal [:a, :b, :c], $arr + end + + test "if specified, only those plugins are loaded" do + add_to_config "config.plugins = [:b_plugin]" + boot_rails + assert_equal [:b], $arr + end + + test "the plugins are initialized in the order they are specified" do + add_to_config "config.plugins = [:b_plugin, :a_plugin]" + boot_rails + assert_equal [:b, :a], $arr + end + + test "if :all is specified, the remaining plugins are loaded in alphabetical order" do + add_to_config "config.plugins = [:c_plugin, :all]" + boot_rails + assert_equal [:c, :a, :b], $arr + end + + test "if :all is at the beginning, it represents the plugins not otherwise specified" do + add_to_config "config.plugins = [:all, :b_plugin]" + boot_rails + assert_equal [:a, :c, :b], $arr + end + + test "plugin order array is strings" do + add_to_config "config.plugins = %w( c_plugin all )" + boot_rails + assert_equal [:c, :a, :b], $arr + end + end +end
\ No newline at end of file diff --git a/railties/test/plugins/vendored_test.rb b/railties/test/railties/plugin_test.rb index c14178ec66..65d057383c 100644 --- a/railties/test/plugins/vendored_test.rb +++ b/railties/test/railties/plugin_test.rb @@ -1,7 +1,7 @@ require "isolation/abstract_unit" -module PluginsTest - class VendoredTest < Test::Unit::TestCase +module RailtiesTest + class PluginTest < Test::Unit::TestCase include ActiveSupport::Testing::Isolation def setup @@ -331,56 +331,4 @@ YAML boot_rails end end - - class VendoredOrderingTest < Test::Unit::TestCase - include ActiveSupport::Testing::Isolation - - def setup - build_app - $arr = [] - plugin "a_plugin", "$arr << :a" - plugin "b_plugin", "$arr << :b" - plugin "c_plugin", "$arr << :c" - end - - def boot_rails - super - require "#{app_path}/config/environment" - end - - test "plugins are loaded alphabetically by default" do - boot_rails - assert_equal [:a, :b, :c], $arr - end - - test "if specified, only those plugins are loaded" do - add_to_config "config.plugins = [:b_plugin]" - boot_rails - assert_equal [:b], $arr - end - - test "the plugins are initialized in the order they are specified" do - add_to_config "config.plugins = [:b_plugin, :a_plugin]" - boot_rails - assert_equal [:b, :a], $arr - end - - test "if :all is specified, the remaining plugins are loaded in alphabetical order" do - add_to_config "config.plugins = [:c_plugin, :all]" - boot_rails - assert_equal [:c, :a, :b], $arr - end - - test "if :all is at the beginning, it represents the plugins not otherwise specified" do - add_to_config "config.plugins = [:all, :b_plugin]" - boot_rails - assert_equal [:a, :c, :b], $arr - end - - test "plugin order array is strings" do - add_to_config "config.plugins = %w( c_plugin all )" - boot_rails - assert_equal [:c, :a, :b], $arr - end - end end |