* Allow no_* to be used for every tests in condition DSL: condition { no_has_env :shell, '/bin/sh' }; * Modify Test constructor to accept negated: named argument, implement #negated? and #pass?; * Rename #success? to #verify in all test classes.
22 lines
351 B
Ruby
22 lines
351 B
Ruby
module Producer
|
|
module Core
|
|
class Test
|
|
attr_reader :env, :arguments
|
|
|
|
def initialize(env, *arguments, negated: false)
|
|
@env = env
|
|
@arguments = arguments
|
|
@negated = negated
|
|
end
|
|
|
|
def negated?
|
|
@negated
|
|
end
|
|
|
|
def pass?
|
|
verify ^ negated?
|
|
end
|
|
end
|
|
end
|
|
end
|