pushpop-slack 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 658012ae74ae71ac2c98d20806723256d045224a
4
- data.tar.gz: d4677b9f68af36119b758b639bef9f936b1b9b7a
3
+ metadata.gz: 5c96e1ef88b8aa2058cd8957d9ff48ba35fdba0d
4
+ data.tar.gz: d499452bc3311a9f718a63148b5e081f96c49f7c
5
5
  SHA512:
6
- metadata.gz: f0f5e83d54726f31a07c9e85c71d97576c69caba6019ddd5766bdc59bd1f647d58b3afd1bab42d76b891c122dd3646b76fd3f939e6cf3bce7f692468ea241cb0
7
- data.tar.gz: f31d224af9df3cbf7403ab9070c1c298f04275ec38f4e47b6f637f85677ae30b27b38211c7141f605ca6616082682aa932a3c72ea2569d627435a3c23da3f0fb
6
+ metadata.gz: 40dbd400ae0471435bc29bfdeb92173474f0055e4a721fef75edfcaa345e34ccef474ebef40ca25c536d766ce26ac4876389fc7c0b9847a1133db9d418e69352
7
+ data.tar.gz: 0c961695f21125d385b678fd3df5797cbaca665663eb2ae9d6314d9b68964bb542f6a89f9fd3b869bfec50a99144e6b1855dec0d1e135e5b817b8bbccabc02ed
@@ -21,6 +21,7 @@ module Pushpop
21
21
 
22
22
  def run(last_response=nil, step_responses=nil)
23
23
 
24
+
24
25
  ret = configure(last_response, step_responses)
25
26
 
26
27
  if _message
@@ -29,9 +30,20 @@ module Pushpop
29
30
  Pushpop.logger.debug("No slack message sent - message was not set")
30
31
  end
31
32
 
33
+ clear_settings
34
+
32
35
  ret
33
36
  end
34
37
 
38
+ def clear_settings
39
+ self._username = nil
40
+ self._message = nil
41
+ self._icon = nil
42
+ self._icon_type = nil
43
+ self._attachments = nil
44
+ self._unfurl = nil
45
+ end
46
+
35
47
  def send_message
36
48
  unless WEBHOOK_URL.nil? || WEBHOOK_URL.empty?
37
49
  notifier = ::Slack::Notifier.new WEBHOOK_URL
@@ -1,5 +1,5 @@
1
1
  module Pushpop
2
2
  class Slack
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
4
4
  end
5
5
  end
@@ -139,4 +139,45 @@ describe Pushpop::Slack do
139
139
 
140
140
  expect(step.options['unfurl_links']).to eq(true)
141
141
  end
142
+
143
+ it 'clears everything out at the beginning of the run' do
144
+ username = nil
145
+ message = nil
146
+ icon = nil
147
+ icon_type = nil
148
+ attachments = nil
149
+ unf = nil
150
+
151
+ step = Pushpop::Slack.new do
152
+ username = self._username
153
+ message = self._message
154
+ icon = self._icon
155
+ icon_type = self._icon_type
156
+ attachments = self._attachments
157
+ unf = self._unfurl
158
+
159
+ attch = { test: 'thing' }
160
+
161
+ message 'test'
162
+ channel '#test'
163
+ username 'test'
164
+ icon 'http://a.fake.url'
165
+ attachment attch
166
+ attachment attch
167
+ unfurl true
168
+ end
169
+
170
+ step.configure
171
+
172
+ # Run it twice - the first time sets values
173
+ step.run
174
+ step.run
175
+
176
+ expect(username).to be_nil
177
+ expect(message).to be_nil
178
+ expect(icon).to be_nil
179
+ expect(icon_type).to be_nil
180
+ expect(attachments).to be_nil
181
+ expect(unf).to be_nil
182
+ end
142
183
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushpop-slack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Wegner