forked from coinbase/temporal-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdynamic_workflow_spec.rb
More file actions
37 lines (31 loc) · 842 Bytes
/
dynamic_workflow_spec.rb
File metadata and controls
37 lines (31 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
require 'workflows/delegator_workflow'
describe 'Dynamic workflows' do
let(:workflow_id) { SecureRandom.uuid }
it 'can delegate to other classes' do
# PlusExecutor and TimesExecutor do not subclass Workflow
run_id = Temporal.start_workflow(
PlusExecutor,
{a: 5, b: 3},
options: {
workflow_id: workflow_id
})
result = Temporal.await_workflow_result(
PlusExecutor,
workflow_id: workflow_id,
run_id: run_id,
)
expect(result[:computation]).to eq(8)
run_id = Temporal.start_workflow(
TimesExecutor,
{a: 5, b: 3},
options: {
workflow_id: workflow_id
})
result = Temporal.await_workflow_result(
TimesExecutor,
workflow_id: workflow_id,
run_id: run_id,
)
expect(result[:computation]).to eq(15)
end
end