test/scout/tsv/test_parser.rb in scout-gear-8.0.0 vs test/scout/tsv/test_parser.rb in scout-gear-8.1.0
- old
+ new
@@ -117,9 +117,23 @@
tsv = TSV.parse(content, fields: %w(ValueB Key))
assert_equal [%w(b B), %w(k)], tsv['k']
end
+ def test_parse_flat
+ content =<<-EOF
+#: :sep=" "#:type=:flat
+#Key ValueA
+row1 a aa aaa
+row2 b bb bbb
+ EOF
+
+ tsv = TSV.open(content)
+ assert_equal %w(a aa aaa), tsv["row1"]
+ tsv = TSV.open(content, :fields => ["ValueA"])
+ assert_equal %w(a aa aaa), tsv["row1"]
+ end
+
def test_parse_key
content =<<-EOF
#: :sep=" "#:type=:double
#Key ValueA ValueB
k a|A b|B