Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a test for the rc commandline option

  • Loading branch information...
commit 2f11668eb844f6d7d64eaf4b4856d8a8b41e3a0c 1 parent 327c602
@tenderlove tenderlove authored
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
@@ -64,6 +64,24 @@ def test_new_homedir_rc
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!
Please sign in to comment.
Something went wrong with that request. Please try again.