Skip to content

Commit db86b85

Browse files
committed
Basic unit test for #all and #any
1 parent eba0925 commit db86b85

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/workflow/dsl_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
require 'factor/workflow/dsl'
66
require 'factor/connector'
77
require 'factor/workflow/connector_future'
8+
require 'factor/workflow/future'
89

910
describe Factor::Workflow::DSL do
1011
it 'can log' do
@@ -39,4 +40,16 @@ def initialize(options={})
3940
expect(connector_future.action).to be_a(Sample)
4041
expect(connector_future.action.test_param).to eq('foo')
4142
end
43+
44+
it 'aggregators return a future' do
45+
f1 = Factor::Workflow::Future.new { 1 }
46+
f2 = Factor::Workflow::Future.new { 2 }
47+
dsl = Factor::Workflow::DSL.new
48+
49+
expect(Factor::Workflow::Future).to receive(:any)
50+
dsl.any(f1,f1)
51+
52+
expect(Factor::Workflow::Future).to receive(:all)
53+
dsl.all(f1,f1)
54+
end
4255
end

0 commit comments

Comments
 (0)