Class: TestCase
- Inherits:
-
Object
- Object
- TestCase
- Defined in:
- lib/marmalade/test_case.rb
Instance Attribute Summary collapse
-
#case_num ⇒ Object
Returns the value of attribute case_num.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#output ⇒ Object
Returns the value of attribute output.
-
#run_block ⇒ Object
Returns the value of attribute run_block.
Instance Method Summary collapse
-
#initialize(case_num, options = {}) ⇒ TestCase
constructor
A new instance of TestCase.
- #puts(*args) ⇒ Object
- #puts_dbg(*args) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(case_num, options = {}) ⇒ TestCase
Returns a new instance of TestCase.
7 8 9 10 11 |
# File 'lib/marmalade/test_case.rb', line 7 def initialize(case_num, = {}) self.case_num = case_num @output = [:output] || STDOUT @options = end |
Instance Attribute Details
#case_num ⇒ Object
Returns the value of attribute case_num.
2 3 4 |
# File 'lib/marmalade/test_case.rb', line 2 def case_num @case_num end |
#debug ⇒ Object
Returns the value of attribute debug.
3 4 5 |
# File 'lib/marmalade/test_case.rb', line 3 def debug @debug end |
#output ⇒ Object
Returns the value of attribute output.
4 5 6 |
# File 'lib/marmalade/test_case.rb', line 4 def output @output end |
#run_block ⇒ Object
Returns the value of attribute run_block.
5 6 7 |
# File 'lib/marmalade/test_case.rb', line 5 def run_block @run_block end |
Instance Method Details
#puts(*args) ⇒ Object
19 20 21 |
# File 'lib/marmalade/test_case.rb', line 19 def puts(*args) puts_with_case(*args) end |
#puts_dbg(*args) ⇒ Object
23 24 25 |
# File 'lib/marmalade/test_case.rb', line 23 def puts_dbg(*args) puts_with_case(*args) if debug end |
#run ⇒ Object
13 14 15 16 17 |
# File 'lib/marmalade/test_case.rb', line 13 def run unless @run_block.nil? instance_eval(&@run_block) end end |