Class: Omnitest::OutputHelper::StringShell
- Inherits:
-
Object
- Object
- Omnitest::OutputHelper::StringShell
- Defined in:
- lib/omnitest/output_helper.rb
Instance Attribute Summary collapse
-
#io ⇒ Object
(also: #stdout, #stderr)
readonly
Returns the value of attribute io.
Instance Method Summary collapse
- #can_display_colors? ⇒ Boolean
-
#initialize(*args) ⇒ StringShell
constructor
A new instance of StringShell.
- #string ⇒ Object
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
#io ⇒ Object (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
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 |
#string ⇒ Object
14 15 16 |
# File 'lib/omnitest/output_helper.rb', line 14 def string @io.string end |