diff options
Diffstat (limited to 'test/lib/test-helpers.rb')
-rw-r--r-- | test/lib/test-helpers.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/lib/test-helpers.rb b/test/lib/test-helpers.rb index d2989e0..672a2c2 100644 --- a/test/lib/test-helpers.rb +++ b/test/lib/test-helpers.rb @@ -2,7 +2,7 @@ module TestHelpers # Runs gemma and returns true if successful def gemma(opts) - system("./bin/gemma #{opts}") + assert system("./bin/gemma #{opts}") end def read(fn, line=0) @@ -18,11 +18,15 @@ module TestHelpers lines = lines.map { |l| l.split("\t") } # avoid this for large files list.each do | l | line,colnum,value = l - if line == :max - cols = lines.max_by {|a| a[colnum].to_f} - else - cols = lines[line] + if colnum.is_a? String + colnum = lines[0].index(colnum) end + cols = + if line == :max + lines.max_by {|a| a[colnum].to_f} + else + lines[line] + end # assert_equal value,cols[colnum] assert_in_delta value.to_f,cols[colnum].to_f, 0.001 end |