#!/usr/bin/env ruby
-# Copyright (C) 2007-2010 Martin A. Hansen.
+# Copyright (C) 2007-2011 Martin A. Hansen.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
assert_nothing_raised(ArgumentError) { Biopieces.options_parse(argv, casts, SCRIPT_PATH) }
end
-# # TODO replace the absolute part below the file location with File.dirname(__FILE__)
-# def test_Biopieces_options_parse_with_glob_argument_expands_correctly
-# flunk("This test is flawed and need fixing")
-# argv = ["--foo", "/Users/maasha/unit_test/foo*,/Users/maasha/unit_test/my_dir/*.fna", "-I", DUMMY_FILE]
-# casts = [{:long=>"foo", :short=>"f", :type=>"files!", :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}]
-# options = Biopieces.options_parse(argv, casts, SCRIPT_PATH)
-# assert_equal(["/Users/maasha/unit_test/foo.fna", "/Users/maasha/unit_test/my_dir/bar.fna"], options[:foo])
-# end
+ def test_Biopieces_options_parse_with_glob_argument_expands_correctly
+ path = File.join(ENV['BP_DIR'], "bp_test")
+ argv = ["--foo", "#{path}/te*,#{path}/lib/*.sh", "-I", DUMMY_FILE]
+ casts = [{:long=>"foo", :short=>"f", :type=>"files!", :mandatory=>false, :default=>nil, :allowed=>nil, :disallowed=>nil}]
+ options = Biopieces.options_parse(argv, casts, SCRIPT_PATH)
+ assert_equal(["#{path}/test_all", "#{path}/lib/test.sh"], options[:foo])
+ end
def test_Biopieces_options_parse_with_dir_cast_and_dir_dont_exists_raises
argv = ["--foo", "bleh", "-I", DUMMY_FILE]