Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Larry Diehl
committed
Aug 29, 2009
1 parent
f4ce4f2
commit 5199701
Showing
3 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require "#{File.dirname(__FILE__)}/spec_helper" | ||
|
||
describe 'Setting a customer forker' do | ||
before(:all) do | ||
@original_forker = Dataflow.forker | ||
Dataflow.forker = Class.new do | ||
def self.synchronous_forker(&block) | ||
block.call | ||
end | ||
end.method(:synchronous_forker) | ||
end | ||
|
||
after(:all) do | ||
Dataflow.forker = @original_forker | ||
end | ||
|
||
it 'uses the custom forker in #flow' do | ||
local do |my_var| | ||
flow(my_var) { 1337 } | ||
my_var.should == 1337 | ||
end | ||
end | ||
|
||
it 'uses the custom forker in #need_later' do | ||
my_var = need_later { 1337 } | ||
my_var.should == 1337 | ||
end | ||
end |