提交 7d01907f 编写于 作者: A Aaron Patterson

adding a test for the current behavior

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