Sha256: 8ecc7859ff71392efcd5ab831ed01f4f15f277c9bc7145cc0398afb3efc900b4

Contents?: true

Size: 1.63 KB

Versions: 24

Compression:

Stored size: 1.63 KB

Contents

shared_context "stubbed stack" do |name, environment, options|
  before do
    args = { :name => name, :environment => environment }
    args[:use_internal_ips] = options[:internal] if options && options[:internal]
    @stack_mock = mock 'stack mock', args
    SimpleDeploy::Stack.stub(:new).and_return(@stack_mock)
  end
end

shared_context "double stubbed stack" do |name, environment, options|
  before do
    args = { :name => name, :environment => environment }
    args[:use_internal_ips] = options[:internal] if options && options[:internal]
    @stack_stub = stub 'stack stub', args
    SimpleDeploy::Stack.stub(:new).and_return(@stack_stub)
  end
end

shared_context "clone stack pair" do |source_name, source_env, new_name, new_env|
  before do
    @source_stack_stub = stub 'source stack stub', :name => source_name,
                                                   :environment => source_env
    @new_stack_mock    = mock 'new stack mock', :name => new_name,
                                                :environment => new_env
    SimpleDeploy::Stack.stub(:new).and_return(@source_stack_stub, @new_stack_mock)
  end
end

shared_context "received stack array" do |base_name, env, num_instances|
  before do
    1.upto(num_instances) do |n|
      name = "#{base_name}#{n}"
      stack_mock = mock 'stack mock', :name => name, :environment => env
      self.instance_variable_set(:"@stack_mock#{n}", stack_mock)
      SimpleDeploy::Stack.should_receive(:new).with(:name        => name,
                                                    :environment => env).
                                                    and_return(stack_mock)
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
simple_deploy-0.10.2 spec/contexts/stack_contexts.rb
simple_deploy-0.10.1 spec/contexts/stack_contexts.rb
simple_deploy-0.10.0 spec/contexts/stack_contexts.rb
simple_deploy-0.10.0.beta.3 spec/contexts/stack_contexts.rb
simple_deploy-0.10.0.beta.2 spec/contexts/stack_contexts.rb
simple_deploy-0.10.0.beta.1 spec/contexts/stack_contexts.rb
simple_deploy-0.9.2 spec/contexts/stack_contexts.rb
simple_deploy-0.9.1 spec/contexts/stack_contexts.rb
simple_deploy-0.9.0 spec/contexts/stack_contexts.rb
simple_deploy-0.8.2 spec/contexts/stack_contexts.rb
simple_deploy-0.8.2.beta1 spec/contexts/stack_contexts.rb
simple_deploy-0.8.1.beta1 spec/contexts/stack_contexts.rb
simple_deploy-0.8.0 spec/contexts/stack_contexts.rb
simple_deploy-0.7.8 spec/contexts/stack_contexts.rb
simple_deploy-0.7.7 spec/contexts/stack_contexts.rb
simple_deploy-0.7.7.beta.1 spec/contexts/stack_contexts.rb
simple_deploy-0.7.6 spec/contexts/stack_contexts.rb
simple_deploy-0.7.6.beta.6 spec/contexts/stack_contexts.rb
simple_deploy-0.7.6.beta.5 spec/contexts/stack_contexts.rb
simple_deploy-0.7.6.beta.3 spec/contexts/stack_contexts.rb