test/rbbt/tsv/test_manipulate.rb in rbbt-util-5.1.0 vs test/rbbt/tsv/test_manipulate.rb in rbbt-util-5.2.0
- old
+ new
@@ -222,7 +222,25 @@
assert_equal ["row1", "row3"].sort, tsv.reorder("ValueA")["a"]
end
end
+ def test_transpose
+ content =<<-EOF
+#: :type=:list
+#Row vA vB vID
+row1 a b Id1
+row2 A B Id3
+row3 a C Id4
+ EOF
+
+ TmpFile.with_file(content) do |filename|
+ tsv = TSV.open(filename, :sep => /\s+/)
+
+ assert_equal %w(vA vB vID), tsv.transpose("Values").keys
+
+ end
+
+ end
+
end