Sha256: 2dd41bb935bc84806a6a40cf33e2bd0312c4e9001b02b18ce4040f4f365b87d1

Contents?: true

Size: 1.51 KB

Versions: 91

Compression:

Stored size: 1.51 KB

Contents

require '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

91 entries across 91 versions & 1 rubygems

Version Path
engineyard-serverside-1.6.5 spec/restart_spec.rb
engineyard-serverside-2.0.0.pre3 spec/restart_spec.rb
engineyard-serverside-2.0.0.pre2 spec/restart_spec.rb
engineyard-serverside-2.0.0.pre1 spec/restart_spec.rb
engineyard-serverside-1.7.0.pre2 spec/restart_spec.rb
engineyard-serverside-1.6.4 spec/restart_spec.rb
engineyard-serverside-1.6.4.pre6 spec/restart_spec.rb
engineyard-serverside-1.6.4.pre5 spec/restart_spec.rb
engineyard-serverside-1.6.4.pre4 spec/restart_spec.rb
engineyard-serverside-1.6.4.pre3 spec/restart_spec.rb
engineyard-serverside-1.6.4.pre2 spec/restart_spec.rb
engineyard-serverside-1.6.4.pre spec/restart_spec.rb
engineyard-serverside-1.6.3 spec/restart_spec.rb
engineyard-serverside-1.5.35.pre.2 spec/restart_spec.rb
engineyard-serverside-1.5.35.pre.1 spec/restart_spec.rb
engineyard-serverside-1.5.33 spec/restart_spec.rb
engineyard-serverside-1.5.32 spec/restart_spec.rb
engineyard-serverside-1.6.0.pre5 spec/restart_spec.rb
engineyard-serverside-1.5.30 spec/restart_spec.rb
engineyard-serverside-1.6.0.pre4 spec/restart_spec.rb