diff options
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! |