diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 15:41:09 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 15:41:09 -0700 |
commit | 7d01907f95ec2fdbf1b5641987396193277e64c3 (patch) | |
tree | a9344e1b2fa2113de97d99e669952ef8e800eec1 /railties/test | |
parent | 2f11668eb844f6d7d64eaf4b4856d8a8b41e3a0c (diff) | |
download | rails-7d01907f95ec2fdbf1b5641987396193277e64c3.tar.gz rails-7d01907f95ec2fdbf1b5641987396193277e64c3.tar.bz2 rails-7d01907f95ec2fdbf1b5641987396193277e64c3.zip |
adding a test for the current behavior
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/argv_scrubber_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/generators/argv_scrubber_test.rb b/railties/test/generators/argv_scrubber_test.rb index 2d2e81bf2c..6030139d88 100644 --- a/railties/test/generators/argv_scrubber_test.rb +++ b/railties/test/generators/argv_scrubber_test.rb @@ -82,6 +82,24 @@ module Rails file.unlink end + def test_new_rc_option_and_custom_options + file = Tempfile.new 'myrcfile' + file.puts '--hello-world' + file.flush + + message = nil + scrubber = Class.new(ARGVScrubber) { + define_method(:puts) { |msg| message = msg } + }.new ['new', '--tender', '--love', "--rc=#{file.path}"] + args = scrubber.prepare! + assert_equal ['--tender', '--hello-world', '--love'], args + assert_match 'hello-world', message + assert_match file.path, message + ensure + file.close + file.unlink + end + def test_no_rc scrubber = ARGVScrubber.new ['new', '--no-rc'] args = scrubber.prepare! |