Sha256: ccd9b3a1627021444fcbfa4ef63fec7aee0d5a1f15426d51ff341a6368af2645

Contents?: true

Size: 573 Bytes

Versions: 8

Compression:

Stored size: 573 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
require 'rbbt/util/R'

class TestR < Test::Unit::TestCase
  def test_sum
    assert_equal "6", R.run('cat(3+3)').read.split(/\n/).last
  end

  def test_tsv_R
    tsv = TSV.setup({:a => 1, :b => 2})
    tsv2 = tsv.R <<-EOF
data = data + 1
    EOF
    assert_equal "2", tsv2["a"].first
  end

  def test_format_tsv
    tsv = TSV.setup({"a" => [1], "b" => [2]}, :type => :list, :key_field => "Letter", :fields => ["Number"])
    assert tsv.transpose("Field").include? "Number"
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rbbt-util-5.13.6 test/rbbt/util/test_R.rb
rbbt-util-5.13.5 test/rbbt/util/test_R.rb
rbbt-util-5.13.4 test/rbbt/util/test_R.rb
rbbt-util-5.13.3 test/rbbt/util/test_R.rb
rbbt-util-5.13.2 test/rbbt/util/test_R.rb
rbbt-util-5.13.1 test/rbbt/util/test_R.rb
rbbt-util-5.13.0 test/rbbt/util/test_R.rb
rbbt-util-5.12.3 test/rbbt/util/test_R.rb