1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

change the test to make argv a little more realistic

This commit is contained in:
Aaron Patterson 2013-10-30 15:49:47 -07:00
parent 7d01907f95
commit 169fa516c3

View file

@ -84,17 +84,16 @@ module Rails
def test_new_rc_option_and_custom_options
file = Tempfile.new 'myrcfile'
file.puts '--hello-world'
file.puts '--hello'
file.puts '--world'
file.flush
message = nil
scrubber = Class.new(ARGVScrubber) {
define_method(:puts) { |msg| message = msg }
}.new ['new', '--tender', '--love', "--rc=#{file.path}"]
define_method(:puts) { |msg| }
}.new ['new', 'tenderapp', '--love', "--rc=#{file.path}"]
args = scrubber.prepare!
assert_equal ['--tender', '--hello-world', '--love'], args
assert_match 'hello-world', message
assert_match file.path, message
assert_equal ["tenderapp", "--hello", "--world", "--love"], args
ensure
file.close
file.unlink