Class: TC_testCommand::FakeStdOut
- Inherits:
-
Object
- Object
- TC_testCommand::FakeStdOut
- Defined in:
- lib/bbcloud/vendor/gli/test/tc_command.rb
Instance Attribute Summary collapse
-
#strings ⇒ Object
readonly
Returns the value of attribute strings.
Instance Method Summary collapse
-
#contained?(regexp) ⇒ Boolean
Returns true if the regexp matches anything in the output.
- #puts(string = nil) ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#strings ⇒ Object (readonly)
Returns the value of attribute strings.
9 10 11 |
# File 'lib/bbcloud/vendor/gli/test/tc_command.rb', line 9 def strings @strings end |
Instance Method Details
#contained?(regexp) ⇒ Boolean
Returns true if the regexp matches anything in the output
16 17 18 |
# File 'lib/bbcloud/vendor/gli/test/tc_command.rb', line 16 def contained?(regexp) strings.find{ |x| x =~ regexp } end |
#puts(string = nil) ⇒ Object
10 11 12 13 |
# File 'lib/bbcloud/vendor/gli/test/tc_command.rb', line 10 def puts(string=nil) @strings ||= [] @strings << string unless string.nil? end |
#to_s ⇒ Object
20 21 22 |
# File 'lib/bbcloud/vendor/gli/test/tc_command.rb', line 20 def to_s @strings.join("\n") end |