Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsiaw committed Sep 7, 2023
1 parent 230cb03 commit 2a57d5a
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions spec/lib/cloud_formation/executor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,22 @@
end

describe '#create_or_update' do
it 'raises an error if the stack was rolled back' do
allow(executor).to receive(:stack_status) { 'ROLLBACK_COMPLETE' }
expect { executor.create_or_update }.to raise_error CloudFormation::CannotUpdateRolledbackStackException
it 'deletes the stack if it was rolled back' do
status = 'ROLLBACK_COMPLETE'
allow(executor).to receive(:stack_status) { status }

expect(client).to receive(:delete_stack).with({stack_name: "test"}) {
status = 'DELETE_COMPLETE'
}.once

expect(executor).to receive(:create)


executor.create_or_update
end



it 'raises an error if the stack is still being updated' do
allow(executor).to receive(:stack_status) { 'UPDATE_IN_PROGRESS' }
expect { executor.create_or_update }.to raise_error CloudFormation::UpdateInProgressException
Expand Down

0 comments on commit 2a57d5a

Please sign in to comment.