Class: Omnitest::OutputHelper::StringShell

Inherits:
Object
  • Object
show all
Defined in:
lib/omnitest/output_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ StringShell

Returns a new instance of StringShell.



6
7
8
9
# File 'lib/omnitest/output_helper.rb', line 6

def initialize(*args)
  @io = StringIO.new
  super
end

Instance Attribute Details

#ioObject (readonly) Also known as: stdout, stderr

Returns the value of attribute io.



4
5
6
# File 'lib/omnitest/output_helper.rb', line 4

def io
  @io
end

Instance Method Details

#can_display_colors?Boolean

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/omnitest/output_helper.rb', line 18

def can_display_colors?
  # Still capture colors if they can eventually be displayed.
  $stdout.tty?
end

#stringObject



14
15
16
# File 'lib/omnitest/output_helper.rb', line 14

def string
  @io.string
end