Sha256: 8b61a19e2b23cbeb6f2358f9d74d72d93cefb1452df693409cb4e25f8c7b48a0

Contents?: true

Size: 695 Bytes

Versions: 2

Compression:

Stored size: 695 Bytes

Contents

require 'spec_helper'

class DryRunMessaging < Slackistrano::Messaging::Default
  def channels_for(action)
    "testing"
  end
end

describe Slackistrano do
  before(:all) do
    set :slackistrano, { klass: DryRunMessaging }
  end

  %w[starting updating reverting updated reverted failed].each do |stage|
    it "does not post to slack on slack:deploy:#{stage}" do
      allow_any_instance_of(Slackistrano::Capistrano).to receive(:dry_run?).and_return(true)
      expect_any_instance_of(Slackistrano::Capistrano).to receive(:post_dry_run)
      expect_any_instance_of(Slackistrano::Capistrano).not_to receive(:post_to_slack)
      Rake::Task["slack:deploy:#{stage}"].execute
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
slackistrano-4.0.2 spec/dry_run_spec.rb
slackistrano-4.0.1 spec/dry_run_spec.rb