提交 2f11668e 编写于 作者: A Aaron Patterson

add a test for the rc commandline option

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