Sha256: c4512d64573c2f5e4c0164dbacb69305cbf7ccf4613067faf09429c50d4f8895

Contents?: true

Size: 1.05 KB

Versions: 4

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path '../helper', __FILE__

require 'capistrano/configuration'
require 'airbrake/capistrano'

class CapistranoTest < Test::Unit::TestCase
  def setup
    super
    reset_config

    @configuration = Capistrano::Configuration.new
    Airbrake::Capistrano.load_into(@configuration)
    @configuration.dry_run = true
  end

  should "define airbrake:deploy task" do
    assert_not_nil @configuration.find_task('airbrake:deploy')
  end

  should "log when calling airbrake:deploy task" do
    @configuration.set(:current_revision, '084505b1c0e0bcf1526e673bb6ac99fbcb18aecc')
    @configuration.set(:repository, 'repository')
    @configuration.set(:release_path, '/home/deploy/rails_app/hoptoad')
    io = StringIO.new
    logger = Capistrano::Logger.new(:output => io)
    logger.level = Capistrano::Logger::MAX_LEVEL

    @configuration.logger = logger
    @configuration.find_and_execute_task('airbrake:deploy')

    assert io.string.include?('** Notifying Airbrake of Deploy')
    assert io.string.include?('** Airbrake Notification Complete')
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
airbrake-3.1.12 test/capistrano_test.rb
airbrake-3.1.11 test/capistrano_test.rb
airbrake-3.1.10 test/capistrano_test.rb
airbrake-3.1.9 test/capistrano_test.rb