Sha256: 993673e7e68421b1c30d963daaaef60367dca508dfcac1654222e1519ddcebec

Contents?: true

Size: 595 Bytes

Versions: 40

Compression:

Stored size: 595 Bytes

Contents

require File.dirname(__FILE__) + '/helper'

class TestExtio < Test::Unit::TestCase
  def e(st)
    Tracksperanto::ExtIO.new(StringIO.new(st))
  end
  
  def test_gets
    assert_equal "Mary had\n", e("Mary had\n").gets
  end

  def test_gets_and_strip
    assert_equal "Mary had", e("Mary had\na little lamb\n").gets_and_strip
  end

  def test_gets_and_strip_at_end
    s = e("Mary had\na little lamb\n")
    s.gets_and_strip
    s.gets_and_strip
    
    assert_nil s.gets_and_strip
  end
  
  def test_gets_non_empty
    s = e("\n\n\n\nfoo")
    assert_equal "foo", s.gets_non_empty
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
tracksperanto-1.7.0 test/test_extio.rb
tracksperanto-1.6.9 test/test_extio.rb
tracksperanto-1.6.8 test/test_extio.rb
tracksperanto-1.6.7 test/test_extio.rb
tracksperanto-1.6.6 test/test_extio.rb
tracksperanto-1.6.5 test/test_extio.rb
tracksperanto-1.6.4 test/test_extio.rb
tracksperanto-1.6.3 test/test_extio.rb
tracksperanto-1.6.2 test/test_extio.rb
tracksperanto-1.6.1 test/test_extio.rb
tracksperanto-1.6.0 test/test_extio.rb
tracksperanto-1.5.7 test/test_extio.rb
tracksperanto-1.5.6 test/test_extio.rb
tracksperanto-1.5.5 test/test_extio.rb
tracksperanto-1.5.4 test/test_extio.rb
tracksperanto-1.5.3 test/test_extio.rb
tracksperanto-1.5.2 test/test_extio.rb
tracksperanto-1.5.1 test/test_extio.rb
tracksperanto-1.5.0 test/test_extio.rb
tracksperanto-1.4.0 test/test_extio.rb