Class: TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/marmalade/test_case.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  self.case_num = case_num
  @output = options[:output] || STDOUT
  @options = options
end

Instance Attribute Details

#case_numObject

Returns the value of attribute case_num.



2
3
4
# File 'lib/marmalade/test_case.rb', line 2

def case_num
  @case_num
end

#debugObject

Returns the value of attribute debug.



3
4
5
# File 'lib/marmalade/test_case.rb', line 3

def debug
  @debug
end

#outputObject

Returns the value of attribute output.



4
5
6
# File 'lib/marmalade/test_case.rb', line 4

def output
  @output
end

#run_blockObject

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

#runObject



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