Sha256: 71d5374d35f06d39e772b1ec2648a0d8ac03d1fb48853d7210604b908385c78f

Contents?: true

Size: 1.54 KB

Versions: 8

Compression:

Stored size: 1.54 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

class TestRestartDeploy < EY::Serverside::Deploy
  attr_reader :call_order
  def initialize(*a)
    super
    @call_order = []
  end

  def require_custom_tasks()                   @call_order << 'require_custom_tasks'                   end
  def restart()                                @call_order << 'restart'                                end
  def enable_maintenance_page()                @call_order << 'enable_maintenance_page'                end
  def disable_maintenance_page()               @call_order << 'disable_maintenance_page'               end
end

describe "EY::Serverside::Deploy#restart_with_maintenance_page" do

  class TestRestartWithMaintenancePage < TestRestartDeploy
    def conditionally_enable_maintenance_page()  @call_order << 'conditionally_enable_maintenance_page'  end
  end

  it "puts up the maintenance page if necessary, restarts, and takes down the maintenance page" do
    deployer = TestRestartWithMaintenancePage.new(EY::Serverside::Deploy::Configuration.new)
    deployer.restart_with_maintenance_page
    deployer.call_order.should == %w(
      require_custom_tasks
      conditionally_enable_maintenance_page
      restart
      disable_maintenance_page
    )
  end
end

describe "glassfish stack" do

  it "requires a maintenance page" do
    config = EY::Serverside::Deploy::Configuration.new(:stack => 'glassfish')
    deployer = TestRestartDeploy.new(config)
    deployer.restart_with_maintenance_page
    deployer.call_order.should include('enable_maintenance_page')
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
engineyard-serverside-1.4.12 spec/restart_spec.rb
engineyard-serverside-1.4.11 spec/restart_spec.rb
engineyard-serverside-1.4.9.nodestack spec/restart_spec.rb
engineyard-serverside-1.4.8.nodestack spec/restart_spec.rb
engineyard-serverside-1.4.7.pre spec/restart_spec.rb
engineyard-serverside-1.4.3.nodestack spec/restart_spec.rb
engineyard-serverside-1.4.1 spec/restart_spec.rb
engineyard-serverside-1.4.0 spec/restart_spec.rb