diff options
author | Robin Houston <robin@lenny.robin> | 2011-09-08 00:58:31 +0100 |
---|---|---|
committer | Robin Houston <robin@lenny.robin> | 2011-09-08 00:58:31 +0100 |
commit | 0b35486809a9a5ef8ba371549b05390682427392 (patch) | |
tree | 019d6dd61f30b6639eb0585b6db9a618f4e1854e /spec/lib/external_command_spec.rb | |
parent | 6e0e5e5bed89ff2093e1cca3fa50310f678565fd (diff) | |
parent | e35a213a5550382c6aeeeadf29abdd178c87ea32 (diff) |
Merge branch 'wdtk' into develop
Conflicts:
config/general.yml-example
spec/models/track_mailer_spec.rb
Diffstat (limited to 'spec/lib/external_command_spec.rb')
-rw-r--r-- | spec/lib/external_command_spec.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/lib/external_command_spec.rb b/spec/lib/external_command_spec.rb deleted file mode 100644 index 0ff1a9c0a..000000000 --- a/spec/lib/external_command_spec.rb +++ /dev/null @@ -1,40 +0,0 @@ -# This is a test of the external_command library - -require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') -script_dir = File.join(File.dirname(__FILE__), 'external_command_scripts') -output_script = File.join(script_dir, "output.sh") - -require 'external_command' - -describe "when running ExternalCommand" do - - it "should get correct status code for /bin/true" do - t = ExternalCommand.new("/bin/true").run() - t.status.should == 0 - t.out.should == "" - t.err.should == "" - end - - it "should get correct status code for /bin/false" do - f = ExternalCommand.new("/bin/false").run() - f.status.should == 1 - f.out.should == "" - f.err.should == "" - end - - it "should get stdout and stderr" do - f = ExternalCommand.new(output_script, "out", "err", "10", "23").run() - f.status.should == 23 - f.out.should == (0..9).map {|i| "out #{i}\n"}.join("") - f.err.should == (0..9).map {|i| "err #{i}\n"}.join("") - end - - it "should work with large amounts of data" do - f = ExternalCommand.new(output_script, "a longer output line", "a longer error line", "10000", "5").run() - f.status.should == 5 - f.out.should == (0..9999).map {|i| "a longer output line #{i}\n"}.join("") - f.err.should == (0..9999).map {|i| "a longer error line #{i}\n"}.join("") - end - -end - |