diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 15:33:46 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-30 15:33:46 -0700 |
commit | 2f11668eb844f6d7d64eaf4b4856d8a8b41e3a0c (patch) | |
tree | a4e6ac9b267ba15260e943caf786cfddda43d8a3 /railties/test/generators | |
parent | 327c6023cdf17cd1ac557d5db5bccf92dd681292 (diff) | |
download | rails-2f11668eb844f6d7d64eaf4b4856d8a8b41e3a0c.tar.gz rails-2f11668eb844f6d7d64eaf4b4856d8a8b41e3a0c.tar.bz2 rails-2f11668eb844f6d7d64eaf4b4856d8a8b41e3a0c.zip |
add a test for the rc commandline option
Diffstat (limited to 'railties/test/generators')
-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 26b33740c8..2d2e81bf2c 100644 --- a/railties/test/generators/argv_scrubber_test.rb +++ b/railties/test/generators/argv_scrubber_test.rb @@ -64,6 +64,24 @@ module Rails file.unlink end + def test_new_rc_option + file = Tempfile.new 'myrcfile' + file.puts '--hello-world' + file.flush + + message = nil + scrubber = Class.new(ARGVScrubber) { + define_method(:puts) { |msg| message = msg } + }.new ['new', "--rc=#{file.path}"] + args = scrubber.prepare! + assert_equal [nil, '--hello-world'], 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! |