Skip to content

Commit

Permalink
Fix cassette naming within spec abstracts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisroberts committed Jan 15, 2016
1 parent bce78da commit aa52d61
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/miasma/specs/compute_abstract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

before do
unless($miasma_instance)
VCR.use_cassette('Miasma_Models_Compute_Aws/GLOBAL_compute_instance_create') do
VCR.use_cassette('Miasma_Models_Compute_Global/GLOBAL_compute_instance_create') do
@instance = compute.servers.build(build_args)
@instance.save
until(@instance.state == :running)
Expand All @@ -41,7 +41,7 @@
$miasma_instance = @instance
end
Kernel.at_exit do
VCR.use_cassette('Miasma_Models_Compute_Aws/GLOBAL_compute_instance_destroy') do
VCR.use_cassette('Miasma_Models_Compute_Global/GLOBAL_compute_instance_destroy') do
$miasma_instance.destroy
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/miasma/specs/load_balancer_abstract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

before do
unless($miasma_balancer)
VCR.use_cassette('Miasma_Models_LoadBalancer_Aws/GLOBAL_load_balancer_create') do
VCR.use_cassette('Miasma_Models_LoadBalancer_Global/GLOBAL_load_balancer_create') do
@balancer = load_balancer.balancers.build(build_args)
@balancer.save
until(@balancer.state == :active)
Expand All @@ -41,7 +41,7 @@
$miasma_balancer = @balancer
end
Kernel.at_exit do
VCR.use_cassette('Miasma_Models_LoadBalancer_Aws/GLOBAL_load_balancer_destroy') do
VCR.use_cassette('Miasma_Models_LoadBalancer_Global/GLOBAL_load_balancer_destroy') do
$miasma_balancer.destroy
end
end
Expand Down
22 changes: 14 additions & 8 deletions lib/miasma/specs/orchestration_abstract.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'timeout'

MIASMA_ORCHESTRATION_ABSTRACT = ->{

# Required `let`s:
Expand Down Expand Up @@ -31,19 +33,21 @@

before do
unless($miasma_stack)
VCR.use_cassette('Miasma_Models_Orchestration_Aws/GLOBAL_orchestration_stack_create') do
VCR.use_cassette('Miasma_Models_Orchestration_Global/GLOBAL_orchestration_stack_create') do
@stack = orchestration.stacks.build(build_args)
@stack.save
until(@stack.state == :create_complete)
miasma_spec_sleep
@stack.reload
Timeout.timeout(500) do
until(@stack.state == :create_complete)
miasma_spec_sleep
@stack.reload
end
end
@stack.template
orchestration.stacks.reload
$miasma_stack = @stack
end
Kernel.at_exit do
VCR.use_cassette('Miasma_Models_Compute_Aws/GLOBAL_orchestration_stack_destroy') do
VCR.use_cassette('Miasma_Models_Compute_Global/GLOBAL_orchestration_stack_destroy') do
$miasma_stack.destroy
end
end
Expand Down Expand Up @@ -108,9 +112,11 @@
stack.state.must_equal :create_complete
stack.destroy
[:delete_in_progress, :delete_complete].must_include stack.state
until(stack.state == :delete_complete)
miasma_spec_sleep
stack.reload
Timeout.timeout(500) do
until(stack.state == :delete_complete)
miasma_spec_sleep
stack.reload
end
end
stack.state.must_equal :delete_complete
end
Expand Down

0 comments on commit aa52d61

Please sign in to comment.