aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2009-07-03 15:12:18 +0200
committerJosé Valim <jose.valim@gmail.com>2009-07-03 15:12:18 +0200
commit44633dc7a587424d21917413500b2d71fa3d31bb (patch)
tree75601c36883e3ea050882e6cb7f241c0d37f2637 /railties/test/generators_test.rb
parent21db04818e0120a35912cbf57663dfecc9bec4a3 (diff)
downloadrails-44633dc7a587424d21917413500b2d71fa3d31bb.tar.gz
rails-44633dc7a587424d21917413500b2d71fa3d31bb.tar.bz2
rails-44633dc7a587424d21917413500b2d71fa3d31bb.zip
Add some tests for no_color! behavior.
Diffstat (limited to 'railties/test/generators_test.rb')
-rw-r--r--railties/test/generators_test.rb15
1 files changed, 11 insertions, 4 deletions
diff --git a/railties/test/generators_test.rb b/railties/test/generators_test.rb
index ac290b10bb..c49081e5cc 100644
--- a/railties/test/generators_test.rb
+++ b/railties/test/generators_test.rb
@@ -13,14 +13,14 @@ class GeneratorsTest < GeneratorsTestCase
assert_match /Description:/, output
end
- def test_invoke_with_default_behavior
- Rails::Generators::ModelGenerator.expects(:start).with(["Account"], :behavior => :invoke)
+ def test_invoke_with_default_values
+ Rails::Generators::ModelGenerator.expects(:start).with(["Account"], {})
Rails::Generators.invoke :model, ["Account"]
end
- def test_invoke_with_given_behavior
+ def test_invoke_with_config_values
Rails::Generators::ModelGenerator.expects(:start).with(["Account"], :behavior => :skip)
- Rails::Generators.invoke :model, ["Account"], :skip
+ Rails::Generators.invoke :model, ["Account"], :behavior => :skip
end
def test_find_by_namespace_without_base_or_context
@@ -77,4 +77,11 @@ class GeneratorsTest < GeneratorsTestCase
output = capture(:stdout){ Rails::Generators.help }.split("\n").last
assert_equal "Others: active_record:fixjour, fixjour, rails:javascripts.", output
end
+
+ def test_no_color_sets_proper_shell
+ Rails::Generators.no_color!
+ assert_equal Thor::Shell::Basic, Thor::Base.shell
+ ensure
+ Thor::Base.shell = Thor::Shell::Color
+ end
end