Browse files

adding a test for the current behavior

  • Loading branch information...
1 parent 2f11668 commit 7d01907f95ec2fdbf1b5641987396193277e64c3 @tenderlove tenderlove committed Oct 30, 2013
Showing with 18 additions and 0 deletions.
  1. +18 −0 railties/test/generators/argv_scrubber_test.rb
View
18 railties/test/generators/argv_scrubber_test.rb
@@ -82,6 +82,24 @@ def test_new_rc_option
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!

0 comments on commit 7d01907

Please sign in to comment.