Sha256: 5cbd495cc1471d9292ff11a685b9a4059122e6e7dabe3cd733d7c325676a64a0

Contents?: true

Size: 317 Bytes

Versions: 5

Compression:

Stored size: 317 Bytes

Contents

class IOStub < String
  def write(*str)
    self << str.join
  end

  def print(*str)
    write(str.join + $\.to_s)
  end

  def puts(*str)
    write(str.collect { |s| s.to_s.chomp }.concat([nil]).join("\n"))
  end

  def printf(format, *args)
    self << sprintf(format, *args)
  end

  def flush
    self
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
mspec-1.5.16 lib/mspec/helpers/io.rb
mspec-1.5.15 lib/mspec/helpers/io.rb
mspec-1.5.14 lib/mspec/helpers/io.rb
mspec-1.5.13 lib/mspec/helpers/io.rb
mspec-1.5.12 lib/mspec/helpers/io.rb