Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 35 lines (27 sloc) 1.077 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
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(:current_release, '/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
Something went wrong with that request. Please try again.