aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-05-25 00:10:47 -0700
committerJosé Valim <jose.valim@gmail.com>2011-05-25 00:10:47 -0700
commit3b2ee3b2bc3a4092af7074b4b111a48fd52812fa (patch)
treeec064704349bfdf68c04ca8f7e432cfeef7c7a69 /railties/test
parenta5ee94f6a2476bab9650453fcef24f29de00cba2 (diff)
parent944aee7bb1aeae44faf75979e70f35bc3772ad29 (diff)
downloadrails-3b2ee3b2bc3a4092af7074b4b111a48fd52812fa.tar.gz
rails-3b2ee3b2bc3a4092af7074b4b111a48fd52812fa.tar.bz2
rails-3b2ee3b2bc3a4092af7074b4b111a48fd52812fa.zip
Merge pull request #1288 from guilleiguaran/railties-deprecations
Remove Railties deprecated methods
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/paths_test.rb2
-rw-r--r--railties/test/generators/plugin_generator_test.rb71
-rw-r--r--railties/test/paths_test.rb53
3 files changed, 1 insertions, 125 deletions
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
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
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