Sha256: 574fdf193c0d369cc7da0a0c49b54f81229e38494b79dc841cfa67f7c5d98bd0

Contents?: true

Size: 641 Bytes

Versions: 42

Compression:

Stored size: 641 Bytes

Contents

# -*- encoding : utf-8 -*-
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

42 entries across 42 versions & 1 rubygems

Version Path
tracksperanto-3.5.9 test/test_extio.rb
tracksperanto-3.5.8 test/test_extio.rb
tracksperanto-3.5.7 test/test_extio.rb
tracksperanto-3.5.6 test/test_extio.rb
tracksperanto-3.5.5 test/test_extio.rb
tracksperanto-3.5.4 test/test_extio.rb
tracksperanto-3.5.2 test/test_extio.rb
tracksperanto-3.5.1 test/test_extio.rb
tracksperanto-3.5.0 test/test_extio.rb
tracksperanto-3.4.1 test/test_extio.rb
tracksperanto-3.4.0 test/test_extio.rb
tracksperanto-3.3.13 test/test_extio.rb
tracksperanto-3.3.12 test/test_extio.rb
tracksperanto-3.3.11 test/test_extio.rb
tracksperanto-3.3.10 test/test_extio.rb
tracksperanto-3.3.9 test/test_extio.rb
tracksperanto-3.3.8 test/test_extio.rb
tracksperanto-3.3.7 test/test_extio.rb
tracksperanto-3.3.6 test/test_extio.rb
tracksperanto-3.3.0.pre test/test_extio.rb