Sha256: b17421471fca699611d35f78b6c603efc5be8431eb6bd76547f00adf9f55a330

Contents?: true

Size: 685 Bytes

Versions: 11

Compression:

Stored size: 685 Bytes

Contents

require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')

require 'scout/tsv'
class TestTSVUtil < Test::Unit::TestCase
  def test_open_persist
    content =<<-'EOF'
#: :sep=/\s+/#:type=:double#:merge=:concat
#Id    ValueA    ValueB    OtherID
row1    a|aa|aaa    b    Id1|Id2
row2    A    B    Id3
row2    a    a    id3
    EOF

    tsv = TmpFile.with_file(content) do |filename|
      TSV.open(filename, :sep => " " )
    end
    assert_equal %w(row1 row2), tsv.collect{|k,v| k }
    assert NamedArray === tsv.collect{|k,v| v }.first
    assert "row1", tsv["row1"].key
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
scout-gear-10.7.1 test/scout/tsv/test_util.rb
scout-gear-10.7.0 test/scout/tsv/test_util.rb
scout-gear-10.4.0 test/scout/tsv/test_util.rb
scout-gear-10.3.0 test/scout/tsv/test_util.rb
scout-gear-10.2.0 test/scout/tsv/test_util.rb
scout-gear-10.1.0 test/scout/tsv/test_util.rb
scout-gear-10.0.1 test/scout/tsv/test_util.rb
scout-gear-9.1.0 test/scout/tsv/test_util.rb
scout-gear-9.0.0 test/scout/tsv/test_util.rb
scout-gear-8.1.0 test/scout/tsv/test_util.rb
scout-gear-8.0.0 test/scout/tsv/test_util.rb