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
18 19 20 |
# File 'lib/mspec/helpers/io.rb', line 18 def flush self end |
#print(*str) ⇒ Object
6 7 8 |
# File 'lib/mspec/helpers/io.rb', line 6 def print(*str) write(str.join + $\.to_s) end |
#printf(format, *args) ⇒ Object
14 15 16 |
# File 'lib/mspec/helpers/io.rb', line 14 def printf(format, *args) self << sprintf(format, *args) end |
#puts(*str) ⇒ Object
10 11 12 |
# File 'lib/mspec/helpers/io.rb', line 10 def puts(*str) write(str.collect { |s| s.to_s.chomp }.concat([nil]).join("\n")) end |
#write(*str) ⇒ Object
2 3 4 |
# File 'lib/mspec/helpers/io.rb', line 2 def write(*str) self << str.join end |