Omit the test or part of the test.
Example:
def test_omission
omit
# Not reached here
end
def test_omission_with_here
omit do
# Not ran here
end
# Reached here
end
# File lib/test/unit/omission.rb, line 77
77: def omit(message=nil, &block)
78: message ||= "omitted."
79: if block_given?
80: omission = Omission.new(name, filter_backtrace(caller), message)
81: add_omission(omission)
82: else
83: raise OmittedError.new(message)
84: end
85: end
Omit the test or part of the test if condition is true.
Example:
def test_omission
omit_if("".empty?)
# Not reached here
end
def test_omission_with_here
omit_if(true) do
# Not ran here
end
omit_if(false) do
# Reached here
end
# Reached here too
end
# File lib/test/unit/omission.rb, line 105
105: def omit_if(condition, *args, &block)
106: if condition
107: omit(*args, &block)
108: else
109: block.call if block
110: end
111: end
Omit the test or part of the test if condition is not true.
Example:
def test_omission
omit_unless("string".empty?)
# Not reached here
end
def test_omission_with_here
omit_unless(true) do
# Reached here
end
omit_unless(false) do
# Not ran here
end
# Reached here too
end
# File lib/test/unit/omission.rb, line 131
131: def omit_unless(condition, *args, &block)
132: if condition
133: block.call if block
134: else
135: omit(*args, &block)
136: end
137: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.