From 685a9195aa1dcf0231806fe3bc27783145e2100f Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Tue, 24 May 2011 20:52:38 -0500 Subject: Removing deprecated config.paths.app.controller API --- railties/test/application/paths_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/test') diff --git a/railties/test/application/paths_test.rb b/railties/test/application/paths_test.rb index b1ff6e9cb1..03e0247556 100644 --- a/railties/test/application/paths_test.rb +++ b/railties/test/application/paths_test.rb @@ -61,7 +61,7 @@ module ApplicationTests end test "environments has a glob equal to the current environment" do - assert_equal "#{Rails.env}.rb", @paths.config.environments.glob + assert_equal "#{Rails.env}.rb", @paths["config/environments"].glob end test "load path includes each of the paths in config.paths as long as the directories exist" do -- cgit v1.2.3 From ce350de56e266e3febdc810cb83ddb11b69fc4b7 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Tue, 24 May 2011 22:24:09 -0500 Subject: Removing Deprecated Path API tests --- railties/test/paths_test.rb | 53 --------------------------------------------- 1 file changed, 53 deletions(-) (limited to 'railties/test') diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb index 6e4e3446b3..c0f3887263 100644 --- a/railties/test/paths_test.rb +++ b/railties/test/paths_test.rb @@ -227,57 +227,4 @@ class PathsTest < ActiveSupport::TestCase assert @root["app"].autoload? assert_equal ["/app"], @root.autoload_paths end - - # Deprecated API tests - - test "reading a root level path with assignment" do - @root.add "app" - assert_deprecated do - assert_equal ["/foo/bar/app"], @root.app.to_a - end - end - - test "creating a root level path with assignment" do - assert_deprecated do - @root.app = "/foo/bar" - end - assert_equal ["/foo/bar"], @root["app"].to_a - end - - test "creating a root level path without assignment" do - assert_deprecated do - @root.app "/foo/bar" - end - assert_equal ["/foo/bar"], @root["app"].to_a - end - - test "reading a nested level path with assignment" do - @root.add "app" - @root.add "app/model" - assert_deprecated do - assert_equal ["/foo/bar/app/model"], @root.app.model.to_a - end - end - - test "creating a nested level path with assignment" do - @root.add "app" - assert_deprecated do - @root.app.model = "/foo/bar" - end - assert_equal ["/foo/bar"], @root["app/model"].to_a - end - - test "creating a nested level path without assignment" do - @root.add "app" - assert_deprecated do - @root.app.model "/foo/bar" - end - assert_equal ["/foo/bar"], @root["app/model"].to_a - end - - test "trying to access a path that does not exist raises NoMethodError" do - assert_deprecated do - assert_raises(NoMethodError) { @root.app } - end - end end -- cgit v1.2.3 From 6e1dbb87ef1df9d29a6e9944e960899f0edb5cdc Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Tue, 24 May 2011 22:35:05 -0500 Subject: Remove deprecated plugin generator --- railties/test/generators/plugin_generator_test.rb | 71 ----------------------- 1 file changed, 71 deletions(-) delete mode 100644 railties/test/generators/plugin_generator_test.rb (limited to 'railties/test') diff --git a/railties/test/generators/plugin_generator_test.rb b/railties/test/generators/plugin_generator_test.rb deleted file mode 100644 index 5c0774ddbd..0000000000 --- a/railties/test/generators/plugin_generator_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -require 'generators/generators_test_helper' -require 'rails/generators/rails/plugin/plugin_generator' - -class PluginGeneratorTest < Rails::Generators::TestCase - include GeneratorsTestHelper - arguments %w(plugin_fu) - - def test_plugin_skeleton_is_created - silence(:stderr) { run_generator } - year = Date.today.year - - %w( - vendor/plugins - vendor/plugins/plugin_fu - vendor/plugins/plugin_fu/init.rb - vendor/plugins/plugin_fu/install.rb - vendor/plugins/plugin_fu/uninstall.rb - vendor/plugins/plugin_fu/lib - vendor/plugins/plugin_fu/lib/plugin_fu.rb - vendor/plugins/plugin_fu/Rakefile - ).each{ |path| assert_file path } - - %w( - vendor/plugins/plugin_fu/README - ).each{ |path| assert_file path, /PluginFu/ } - - %w( - vendor/plugins/plugin_fu/README - vendor/plugins/plugin_fu/MIT-LICENSE - ).each{ |path| assert_file path, /#{year}/ } - end - - def test_check_class_collision - content = capture(:stderr){ run_generator ["object"] } - assert_match(/The name 'Object' is either already used in your application or reserved/, content) - end - - def test_invokes_default_test_framework - silence(:stderr) { run_generator } - assert_file "vendor/plugins/plugin_fu/test/plugin_fu_test.rb", /class PluginFuTest < ActiveSupport::TestCase/ - assert_file "vendor/plugins/plugin_fu/test/test_helper.rb" - end - - def test_logs_if_the_test_framework_cannot_be_found - content = nil - silence(:stderr) { content = run_generator ["plugin_fu", "--test-framework=rspec"] } - assert_match(/rspec \[not found\]/, content) - end - - def test_creates_tasks_if_required - silence(:stderr) { run_generator ["plugin_fu", "--tasks"] } - assert_file "vendor/plugins/plugin_fu/lib/tasks/plugin_fu_tasks.rake" - end - - def test_creates_generator_if_required - silence(:stderr) { run_generator ["plugin_fu", "--generator"] } - assert_file "vendor/plugins/plugin_fu/lib/generators/templates" - assert_file "vendor/plugins/plugin_fu/lib/generators/plugin_fu_generator.rb", - /class PluginFuGenerator < Rails::Generators::NamedBase/ - end - - def test_plugin_generator_on_revoke - silence(:stderr) { run_generator } - run_generator ["plugin_fu"], :behavior => :revoke - end - - def test_deprecation - output = capture(:stderr) { run_generator } - assert_match(/Plugin generator is deprecated, please use 'rails plugin new' command to generate plugin structure./, output) - end -end -- cgit v1.2.3