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.5.28.pre6 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre5 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre4 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre3 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre2 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre1 spec/restart_spec.rb
engineyard-serverside-1.5.27 spec/restart_spec.rb
engineyard-serverside-1.5.27.pre4 spec/restart_spec.rb
engineyard-serverside-1.5.27.pre3 spec/restart_spec.rb
engineyard-serverside-1.5.27.pre2 spec/restart_spec.rb
engineyard-serverside-1.5.27.pre spec/restart_spec.rb
engineyard-serverside-1.5.26 spec/restart_spec.rb
engineyard-serverside-1.5.23.ruby19.16 spec/restart_spec.rb
engineyard-serverside-1.5.23.ruby19.15 spec/restart_spec.rb
engineyard-serverside-1.5.25 spec/restart_spec.rb
engineyard-serverside-1.5.24 spec/restart_spec.rb
engineyard-serverside-1.5.23.ruby19.14 spec/restart_spec.rb
engineyard-serverside-1.5.23.ruby19.13 spec/restart_spec.rb
engineyard-serverside-1.5.23.ruby19.12 spec/restart_spec.rb
engineyard-serverside-1.5.23.ruby19.11 spec/restart_spec.rb