提交 169fa516 编写于 作者: A Aaron Patterson

change the test to make argv a little more realistic

上级 7d01907f
......@@ -84,17 +84,16 @@ def test_new_rc_option
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册