Skip to content

Commit

Permalink
Add an integration spec
Browse files Browse the repository at this point in the history
  • Loading branch information
antstorm committed Nov 25, 2021
1 parent f7d5b4d commit 7ddbd72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
19 changes: 5 additions & 14 deletions examples/spec/integration/serial_hello_world_workflow_spec.rb
@@ -1,19 +1,10 @@
require 'workflows/serial_hello_world_workflow'

describe SerialHelloWorldWorkflow do
subject { described_class }
describe SerialHelloWorldWorkflow, :integration do
it 'completes' do
result = run_workflow(described_class, 'Alice', 'Bob', 'John')

before { allow(HelloWorldActivity).to receive(:execute!).and_call_original }

it 'executes HelloWorldActivity' do
subject.execute_locally('Alice', 'Bob', 'John')

expect(HelloWorldActivity).to have_received(:execute!).with('Alice').ordered
expect(HelloWorldActivity).to have_received(:execute!).with('Bob').ordered
expect(HelloWorldActivity).to have_received(:execute!).with('John').ordered
end

it 'returns nil' do
expect(subject.execute_locally).to eq(nil)
expect(result.history.events.first.eventType)
.to eq(CadenceThrift::EventType::WorkflowExecutionCompleted)
end
end
4 changes: 4 additions & 0 deletions examples/spec/spec_helper.rb
Expand Up @@ -20,6 +20,8 @@
Bundler.require :default, :test

require 'cadence/testing'
require 'init'
require 'helpers'

RSpec.configure do |config|
# rspec-expectations config goes here. You can use an alternate
Expand Down Expand Up @@ -52,6 +54,8 @@
# triggering implicit auto-inclusion in groups with matching metadata.
config.shared_context_metadata_behavior = :apply_to_host_groups

config.include Helpers, :integration

# The settings below are suggested to provide a good initial experience
# with RSpec, but feel free to customize to your heart's content.
=begin
Expand Down

0 comments on commit 7ddbd72

Please sign in to comment.