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.0.pre3 spec/restart_spec.rb
engineyard-serverside-1.6.0.pre2 spec/restart_spec.rb
engineyard-serverside-1.6.0.pre spec/restart_spec.rb
engineyard-serverside-1.5.29.pre3 spec/restart_spec.rb
engineyard-serverside-1.5.29.pre2 spec/restart_spec.rb
engineyard-serverside-1.5.29.pre1 spec/restart_spec.rb
engineyard-serverside-1.5.29.pre spec/restart_spec.rb
engineyard-serverside-1.5.29.pre.timestamps2 spec/restart_spec.rb
engineyard-serverside-1.5.29.pre.timestamps spec/restart_spec.rb
engineyard-serverside-1.5.28.pre.timestamps4 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre.timestamps3 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre.timestamps2 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre.timestamps spec/restart_spec.rb
engineyard-serverside-1.5.28 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre12 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre11 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre10 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre9 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre8 spec/restart_spec.rb
engineyard-serverside-1.5.28.pre7 spec/restart_spec.rb