spec/shellshot_spec.rb in shellshot-0.3.1 vs spec/shellshot_spec.rb in shellshot-0.4.0

- old
+ new

@@ -29,8 +29,20 @@ it "should raise error if command returned something else." do lambda { Shellshot.exec %q[ruby -e '$stderr << "problem"; exit 1;'] }.should raise_error(Shellshot::CommandError, "problem") end + it "should capture stdout by default" do + cmd = Shellshot::Command.new + cmd.exec %q[ruby -e '$stdout << "test"'] + cmd.stdout_contents.should == "test" + end + + it "should capture stderr by default" do + cmd = Shellshot::Command.new + cmd.exec %q[ruby -e '$stderr << "test"'] + cmd.stderr_contents.should == "test" + end + end # EOF