require 'test/unit' require File.dirname(__FILE__) + '/load_lib_path' require File.dirname(__FILE__) + '/load_bin_path' class ProphProtSummaryTest < Test::Unit::TestCase NODELETE = false def initialize(arg) super(arg) @tfiles = File.dirname(__FILE__) + '/tfiles/' @tf_proph = @tfiles + "opd1/000_020-prot.xml" @tf_summary = @tfiles + "opd1/000_020-prot.summary.html" @tf_bioworks_small = @tfiles + 'bioworks_small.xml' @tf_proph_cat_inv = @tfiles + 'opd1/opd1_cat_inv_small-prot.xml' @cmd = "ruby -I#{LOAD_LIB_PATH} -S protein_summary.rb " end def Xtest_usage assert_match(/usage:/, `#{@cmd}`) end def Xtest_proph_basic #puts @cmd print `#{@cmd} -g 5.0 #{@tf_proph}` assert(File.exist?(@tf_summary), "file #{@tf_summary} exists") string = IO.read(@tf_summary) assert_match(/gi\|16132176\|ref\|NP_418775\.1\|/, string) assert_match(/16132176/, string) File.unlink(@tf_summary) unless NODELETE end def Xtest_bioworks_basic print `#{@cmd} #{@tf_bioworks_small}` # @TODO: need to freeze the output here end def Xtest_bioworks_with_fpr print `#{@cmd} -f #{@tf_bioworks_small} #{@tf_bioworks_small} --fpr` end def test_proph_with_fpr #puts @cmd print `#{@cmd} #{@tf_proph_cat_inv} -f INV_ --fpr` end end