Sha256: e4f7852d5dba61a2afd6732cf80a443552d5c024527c7b8f05db1bf97bc013e2
Contents?: true
Size: 727 Bytes
Versions: 2
Compression:
Stored size: 727 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), "test_helper")) class TestString < Test::Unit::TestCase context "String#lines" do should "return the parts when separated with \\n" do assert_equal ["a\n", "b\n", "c\n"], "a\nb\nc\n".lines.to_a end should "return the parts when separated with \\r\\n" do assert_equal ["a\r\n", "b\r\n", "c\r\n"], "a\r\nb\r\nc\r\n".lines.to_a end should "accept a record separator" do assert_equal ["ax", "bx", "cx"], "axbxcx".lines("x").to_a end should "execute the passed block" do lines = ["a\r\n", "b\r\n", "c\r\n"] "a\r\nb\r\nc\r\n".lines do |line| assert_equal lines.shift, line end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ohm-0.1.0.rc5 | test/1.8.6_test.rb |
ohm-0.1.0.rc4 | test/1.8.6_test.rb |