Sha256: bb712a28398a8b8884f085296946b9b17526e15f6f0c4fcc2c63fd403b9e14f9

Contents?: true

Size: 519 Bytes

Versions: 11

Compression:

Stored size: 519 Bytes

Contents

# class useful for testing output to stdout
class IOString < String
  def write x
    self.<< x
  end
  def readline!
    line = slice!(/^.*(\n|$)/)
    if $1 == "\n" then line.chop! 
    elsif line == "" then nil 
    else line 
    end
  end
  def puts( x ) 
    stdout_orig = $stdout
    $stdout = self
    Kernel.puts x 
    $stdout = stdout_orig
  end
end

module MockStdoutTestCase
  def setup
    @mockout = IOString.new ""
  end
  def teardown
    $stdout = STDOUT
  end
end    


Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
firewatir-1.6.2 unittests/iostring.rb
firewatir-1.2.0 unittests/iostring.rb
firewatir-1.1.1 unittests/iostring.rb
firewatir-1.2.1 unittests/iostring.rb
watir-1.4.1 unittests/iostring.rb
watir-1.5.3 unittests/iostring.rb
watir-1.5.2 unittests/iostring.rb
watir-1.5.4 unittests/iostring.rb
watir-1.5.6 unittests/iostring.rb
watir-1.6.2 unittests/iostring.rb
watir-1.5.5 unittests/iostring.rb