Skip to content

Commit

Permalink
Adding regression testing
Browse files Browse the repository at this point in the history
  • Loading branch information
pjotrp committed Jul 27, 2012
1 parent c721dd7 commit d4816d7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ you don't need to know Ruby to use the command line interface (CLI).

Features:

* Support for TAB and CSV files
* Support for converting TAB and CSV files
* Filter on data
* Transform table and data by column or row
* Recalculate data
Expand All @@ -37,6 +37,10 @@ Features:
* Convert table to RDF (nyi)
* etc. etc.

and bio-table is pretty fast. To convert a 3Mb file of 18670 rows
takes 0.96 second. Adding a filter makes it parse at 1.01 second on
my 3.2 GHz desktop.

Note: this software is under active development, though what is
documented here should just work.

Expand Down
9 changes: 9 additions & 0 deletions features/cli.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@cli
Feature: Command-line interface (CLI)

bio-table has a powerful comman line interface. Here we regression test features.

Scenario: Test the numerical filter by column values
Given I have input file(s) named "test/data/input/table1.csv"
When I execute "./bin/bio-table --num-filter 'values[3] <= 0.05'"
Then I expect the named output to match "table1-0_05"
12 changes: 12 additions & 0 deletions features/step_definitions/cli-feature.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

Given /^I have input file\(s\) named "(.*?)"$/ do |arg1|
@filenames = arg1.split(/,/)
end

When /^I execute "(.*?)"$/ do |arg1|
@cmd = arg1 + ' ' + @filenames.join(' ')
end

Then /^I expect the named output to match "(.*?)"$/ do |arg1|
RegressionTest::CliExec::exec(@cmd,arg1).should be_true
end
4 changes: 4 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
exit e.status_code
end

rootdir = File.dirname(__FILE__) + '/../..'
$LOAD_PATH.unshift(rootdir+'/lib',rootdir+'/../regressiontest/lib')
require 'regressiontest'

$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'bio-table'

Expand Down

0 comments on commit d4816d7

Please sign in to comment.