Sha256: 7ec00ebb108e04c34435bc7b7bb12c30258324dd7f35d7b4ffed4c78b9ece3a2

Contents?: true

Size: 686 Bytes

Versions: 2

Compression:

Stored size: 686 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[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.0 spec/dry_run_spec.rb
slackistrano-3.8.4 spec/dry_run_spec.rb