From: Ryan Davis Date: 2012-09-06T14:42:31+09:00 Subject: Re: Newbie needs help On Sep 5, 2012, at 15:30 , Ken L. wrote: > Ryan Davis wrote in post #1074855: >> On Sep 5, 2012, at 09:33 , Ken L. wrote: >> >>> ruby ~/Ruby_code/Align_against_reference.rb "temp.fastq" >>> "temp.alignment" 0 40 >>> ..........done >>> /home/lok2/bin/ruby/lib/ruby/1.9.1/test/unit.rb:167:in `block in >>> non_options': file not found: 0 (ArgumentError) >> >> test/unit processes options on the command line so you can do things >> like filter tests by regexps. You might be able to pass "--" before your >> args to signal to it that you're done passing it options. > > When I do that, this is what I get: > > ruby ~/Ruby_code/Align_against_reference.rb -- temp.fastq temp.alignment > 0 40 > > /home/lok2/Ruby_code/SeqRead.rb:99:in `initialize': No such file or > directory - -- (Errno::ENOENT) > from /home/lok2/Ruby_code/SeqRead.rb:99:in `open' > from /home/lok2/Ruby_code/SeqRead.rb:99:in `readSingleEnd' > from /home/lok2/Ruby_code/Align_against_reference.rb:8:in > `
' Then it looks like you can't do that. Don't depend on ARGV. Wrap your code under test up into a method and pass ARGV in as an argument from a driver file. Then your tests can pass in whatever they want.