Class: IOStub
Instance Method Summary collapse
- #flush ⇒ Object
- #print(*str) ⇒ Object
- #printf(format, *args) ⇒ Object
- #puts(*str) ⇒ Object
- #write(*str) ⇒ Object
Instance Method Details
#flush ⇒ Object
24 25 26 |
# File 'lib/mspec/helpers/io.rb', line 24 def flush self end |
#print(*str) ⇒ Object
8 9 10 |
# File 'lib/mspec/helpers/io.rb', line 8 def print(*str) write(str.join + $\.to_s) end |
#printf(format, *args) ⇒ Object
20 21 22 |
# File 'lib/mspec/helpers/io.rb', line 20 def printf(format, *args) self << sprintf(format, *args) end |
#puts(*str) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/mspec/helpers/io.rb', line 12 def puts(*str) if str.empty? write "\n" else write(str.collect { |s| s.to_s.chomp }.concat([nil]).join("\n")) end end |
#write(*str) ⇒ Object
4 5 6 |
# File 'lib/mspec/helpers/io.rb', line 4 def write(*str) self << str.join end |