Sha256: b9baa05eddf854cb40bf2f9b3c1999a30820bfd0f5e73166b9ca272ac7a37537
Contents?: true
Size: 644 Bytes
Versions: 25
Compression:
Stored size: 644 Bytes
Contents
# encoding: UTF-8 require File.expand_path("./helper", File.dirname(__FILE__)) prepare.clear test "String#lines should return the parts when separated with \\n" do assert ["a\n", "b\n", "c\n"] == "a\nb\nc\n".lines.to_a end test "String#lines return the parts when separated with \\r\\n" do assert ["a\r\n", "b\r\n", "c\r\n"] == "a\r\nb\r\nc\r\n".lines.to_a end test "String#lines accept a record separator" do assert ["ax", "bx", "cx"] == "axbxcx".lines("x").to_a end test "String#lines 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 lines.shift == line end end
Version data entries
25 entries across 25 versions & 1 rubygems