Skip to content

Commit

Permalink
Working through lingering issues with FCSH and FDB
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebayes committed Jan 18, 2011
1 parent ab3ba31 commit 00ade91
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.8.pre
1.1.9.pre
8 changes: 8 additions & 0 deletions lib/sprout/executable/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ def stdout
@stdout ||= Sprout.stdout
end

def stderr=(io)
@stderr = io
end

def stderr
@stderr ||= Sprout.stderr
end

def parse! commandline_options
begin
option_parser.parse! commandline_options
Expand Down
20 changes: 20 additions & 0 deletions test/unit/executable_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,26 @@ class ExecutableTest < Test::Unit::TestCase
assert_equal "---string-param=string1", @tool.to_shell
end

should "create default stdout" do
assert_equal Sprout.stdout, @tool.stdout
end

should "accept custom stdout" do
out = StringIO.new
@tool.stdout = out
assert_equal out, @tool.stdout
end

should "create default stderr" do
assert_equal Sprout.stderr, @tool.stderr
end

should "accept custom stderr" do
err = StringIO.new
@tool.stderr = err
assert_equal err, @tool.stderr
end

should "not share parameter values across instances" do
first = FakeOtherExecutableTask.new
second = FakeOtherExecutableTask.new
Expand Down

0 comments on commit 00ade91

Please sign in to comment.