Sha256: 8794ec9479ae736385f29803e38c19011aac072571098feb572b28ae648a66f8

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

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

require 'capistrano/configuration'
require 'pulse/capistrano'

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

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

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

  should "log when calling pulse: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('pulse:deploy')

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
projectlocker_pulse-1.0.0 test/capistrano_test.rb
projectlocker_pulse-0.2.1 test/capistrano_test.rb