Skip to content

Commit

Permalink
Refactoring: stemcell_manager2_spec.rb: Added a missing context block.
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin-W committed Dec 8, 2021
1 parent aca809f commit 42de316
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/bosh_azure_cpi/spec/unit/stemcell_manager2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,22 @@
.and_return(entities)
end

it 'deletes the stemcell in default storage account' do
# Delete the user images whose prefix is the stemcell_uuid or stemcell_name
expect(azure_client).to receive(:delete_user_image)
.with("#{stemcell_uuid}-postfix").once
expect(azure_client).to receive(:delete_user_image)
.with("#{stemcell_name}-postfix").once
context 'when use_default_account_for_cleaning is false' do
it 'deletes the stemcell in default storage account' do
# Delete the user images whose prefix is the stemcell_uuid or stemcell_name
expect(azure_client).to receive(:delete_user_image)
.with("#{stemcell_uuid}-postfix").once
expect(azure_client).to receive(:delete_user_image)
.with("#{stemcell_name}-postfix").once

# Delete all stemcells with the given stemcell name in all storage accounts
expect(blob_manager).to receive(:delete_blob).twice
# Delete all stemcells with the given stemcell name in all storage accounts
expect(blob_manager).to receive(:delete_blob).twice

# Delete all records whose PartitionKey is the given stemcell name
allow(table_manager).to receive(:delete_entity)
# Delete all records whose PartitionKey is the given stemcell name
allow(table_manager).to receive(:delete_entity)

stemcell_manager2.delete_stemcell(stemcell_name)
stemcell_manager2.delete_stemcell(stemcell_name)
end
end
end

Expand Down

0 comments on commit 42de316

Please sign in to comment.