Module: RubyDocTest

Defined in:
lib/test.rb,
lib/lines.rb,
lib/result.rb,
lib/runner.rb,
lib/statement.rb,
lib/code_block.rb,
lib/rubydoctest.rb,
lib/special_directive.rb

Defined Under Namespace

Classes: CodeBlock, EvaluationError, Lines, Result, Runner, SpecialDirective, Statement, Test

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.ignore_interactiveObject

Returns the value of attribute ignore_interactive.



10
11
12
# File 'lib/rubydoctest.rb', line 10

def ignore_interactive
  @ignore_interactive
end

.output_formatObject



13
14
15
16
17
18
19
20
21
# File 'lib/rubydoctest.rb', line 13

def output_format
  if @output_format == :ansi or (@output_format.nil? and STDOUT.tty?)
    :ansi
  elsif @output_format == :html
    :html
  else
    :plain
  end
end

.testsObject

Returns the value of attribute tests.



10
11
12
# File 'lib/rubydoctest.rb', line 10

def tests
  @tests
end

.traceObject

Returns the value of attribute trace.



10
11
12
# File 'lib/rubydoctest.rb', line 10

def trace
  @trace
end

.verboseObject

Returns the value of attribute verbose.



10
11
12
# File 'lib/rubydoctest.rb', line 10

def verbose
  @verbose
end

Class Method Details

.indent(s, level = 4) ⇒ Object



23
24
25
26
# File 'lib/rubydoctest.rb', line 23

def indent(s, level=4)
  spaces = " " * level
  spaces + s.split("\n").join("\n#{spaces}")
end