parent
896173a999
commit
a871baadf5
@ -107,7 +107,7 @@ class BuildOptions
|
||||
end
|
||||
|
||||
def has_opposite_of? option
|
||||
true if args.include? opposite_of option
|
||||
@options.include? opposite_of(option)
|
||||
end
|
||||
|
||||
def opposite_of option
|
||||
|
@ -3,7 +3,7 @@ require 'build_options'
|
||||
|
||||
class BuildOptionsTests < Test::Unit::TestCase
|
||||
def setup
|
||||
args = %w{--with-foo --with-bar --without-qux} # args fake the command line
|
||||
args = %w{--with-foo --with-bar --without-qux}
|
||||
@build = BuildOptions.new(args)
|
||||
@build.add("with-foo")
|
||||
@build.add("with-bar")
|
||||
@ -67,4 +67,8 @@ class BuildOptionsTests < Test::Unit::TestCase
|
||||
assert !@build.has_opposite_of?("--without-qux")
|
||||
assert !@build.has_opposite_of?("--without-nonexisting")
|
||||
end
|
||||
|
||||
def test_actually_recognizes_implicit_options
|
||||
assert @build.has_opposite_of?("--with-baz")
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user