Sha256: e14c51c2dcbabe5a4f2a59a9cb73458237ac37c19f640a80bb30885e7aa1c2e3

Contents?: true

Size: 613 Bytes

Versions: 23

Compression:

Stored size: 613 Bytes

Contents

require File.expand_path(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

23 entries across 23 versions & 1 rubygems

Version Path
tracksperanto-2.8.6 test/test_extio.rb
tracksperanto-2.8.5 test/test_extio.rb
tracksperanto-2.8.4 test/test_extio.rb
tracksperanto-2.8.2 test/test_extio.rb
tracksperanto-2.8.1 test/test_extio.rb
tracksperanto-2.8.0 test/test_extio.rb
tracksperanto-2.7.0 test/test_extio.rb
tracksperanto-2.6.3 test/test_extio.rb
tracksperanto-2.6.2 test/test_extio.rb
tracksperanto-2.6.1 test/test_extio.rb
tracksperanto-2.6.0 test/test_extio.rb
tracksperanto-2.5.0 test/test_extio.rb
tracksperanto-2.4.1 test/test_extio.rb
tracksperanto-2.3.3 test/test_extio.rb
tracksperanto-2.3.2 test/test_extio.rb
tracksperanto-2.3.1 test/test_extio.rb
tracksperanto-2.3.0 test/test_extio.rb
tracksperanto-2.2.4 test/test_extio.rb
tracksperanto-2.2.2 test/test_extio.rb
tracksperanto-2.2.0 test/test_extio.rb