aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generator_lookup_test.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2009-07-30 14:18:53 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-07-30 14:18:53 +0100
commit915cf5747a78f28f2b25c48574031db60c3a18ae (patch)
tree048746387ddaaed418670c86451856675b8d369f /railties/test/generator_lookup_test.rb
parent23f5e7e966defaaa1511eca57bd8de47f95cb7d9 (diff)
parentd83b1828577c268de56e1b3942e16002c9efdd57 (diff)
downloadrails-915cf5747a78f28f2b25c48574031db60c3a18ae.tar.gz
rails-915cf5747a78f28f2b25c48574031db60c3a18ae.tar.bz2
rails-915cf5747a78f28f2b25c48574031db60c3a18ae.zip
Merge commit 'mainstream/master'
Conflicts: railties/guides/source/active_support_overview.textile
Diffstat (limited to 'railties/test/generator_lookup_test.rb')
-rw-r--r--railties/test/generator_lookup_test.rb42
1 files changed, 0 insertions, 42 deletions
diff --git a/railties/test/generator_lookup_test.rb b/railties/test/generator_lookup_test.rb
deleted file mode 100644
index b67087e5ea..0000000000
--- a/railties/test/generator_lookup_test.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'plugin_test_helper'
-
-class GeneratorLookupTest < Test::Unit::TestCase
- def setup
- @fixture_dirs = %w{alternate default}
- @configuration = Rails.configuration = Rails::Configuration.new
- # We need to add our testing plugin directory to the plugin paths so
- # the locator knows where to look for our plugins
- @configuration.plugin_paths += @fixture_dirs.map{|fd| plugin_fixture_path(fd)}
- @initializer = Rails::Initializer.default
- @initializer.config = @configuration
- @initializer.run(:add_plugin_load_paths)
- @initializer.run(:load_plugins)
- @initializer.run(:set_root_path)
- load 'rails_generator.rb'
- require 'rails_generator/scripts'
- end
-
- def test_should_load_from_all_plugin_paths
- assert Rails::Generator::Base.lookup('a_generator')
- assert Rails::Generator::Base.lookup('stubby_generator')
- end
-
- def test_should_create_generator_source_for_each_directory_in_plugin_paths
- sources = Rails::Generator::Base.sources
- @fixture_dirs.each do |gen_dir|
- expected_label = "plugins (fixtures/plugins/#{gen_dir})".to_sym
- assert sources.any? {|source| source.label == expected_label }
- end
- end
-
- def test_should_preserve_order_in_usage_message
- msg = Rails::Generator::Scripts::Base.new.send(:usage_message)
- positions = @fixture_dirs.map do |gen_dir|
- pos = msg.index("Plugins (fixtures/plugins/#{gen_dir})")
- assert_not_nil pos
- pos
- end
- assert_equal positions.sort, positions
- end
-
-end