Add tests for ARGV.filter_for_dependencies
This commit is contained in:
parent
2bacf38833
commit
aed70e50e8
@ -44,4 +44,22 @@ class ARGVTests < Test::Unit::TestCase
|
|||||||
assert !ARGV.switch?('-n')
|
assert !ARGV.switch?('-n')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_filter_for_dependencies_clears_flags
|
||||||
|
ARGV.unshift("--debug")
|
||||||
|
ARGV.filter_for_dependencies do
|
||||||
|
assert ARGV.empty?
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_filter_for_dependencies_ensures_argv_restored
|
||||||
|
ARGV.expects(:replace).with(ARGV.clone)
|
||||||
|
begin
|
||||||
|
ARGV.filter_for_dependencies { raise Exception }
|
||||||
|
rescue Exception
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_filter_for_dependencies_returns_block_value
|
||||||
|
assert_equal 1, ARGV.filter_for_dependencies { 1 }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user