slack-notifier 0.4.0 → 0.4.1

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: 2f1ec45bf7b33fbafc47854195adbd58ef447820
4
- data.tar.gz: 5f941b10ca31632805e4029cc432fee25dbe4de6
3
+ metadata.gz: 9efa003e30e2530dfdb328138ac6b10e9c1ee92b
4
+ data.tar.gz: 388a86cc5af5c0ce1547a2f4b351b81420ec0c40
5
5
  SHA512:
6
- metadata.gz: 2869813080b6254ae2bd41124ea10003b2a863721baa26710c4f86c455d15490f37f9660d7486465b11d3a0785c11e24b62f92200de4943ddbc42995a0f10fcb
7
- data.tar.gz: 27943e0d35aedeee68ef5576419a4d4cbc79073f1f2ca21ce92a779eadc473f3f993dc289f10c232edb9f03e03d83069e043f678ad515a968eaa99f2c93f3aa5
6
+ metadata.gz: f5d939b3ec86e70ee8d13bf9438ebf9cbb1957a374c3622d8e5510df0d5c504f83067ec729cdfd38450f292f52c09eb2acb72aef4d2765a7352241cd4d41efc6
7
+ data.tar.gz: ea3ff1b881b8dcc442bc2fd6939b24a56208e38592e961fad1c1dbdf56713f0221d929787bca67b526f98ef55bd652e04772f2d42b705fded3d37639d08ba657
@@ -27,8 +27,8 @@ module Slack
27
27
  HTTPPost.to endpoint, payload: payload.to_json
28
28
  end
29
29
 
30
- def channel=(channel)
31
- @channel = if channel.start_with?('#')
30
+ def channel= channel
31
+ @channel = if channel.start_with? '#', "@"
32
32
  channel
33
33
  else
34
34
  "##{channel}"
@@ -1,5 +1,5 @@
1
1
  module Slack
2
2
  class Notifier
3
- VERSION = "0.4.0"
3
+ VERSION = "0.4.1"
4
4
  end
5
5
  end
@@ -97,12 +97,20 @@ describe Slack::Notifier do
97
97
  describe "#channel=" do
98
98
  it "sets the given channel" do
99
99
  subject.channel = "#foo"
100
- expect( subject.channel ).to eql "#foo"
100
+ expect( subject.channel ).to eq "#foo"
101
101
  end
102
102
 
103
- it "adds # prefix to channel" do
103
+ it "maintains channel prefix if it is '#' or '@'" do
104
+ subject.channel = "#foo"
105
+ expect( subject.channel ).to eq "#foo"
106
+
107
+ subject.channel = "@foo"
108
+ expect( subject.channel ).to eq "@foo"
109
+ end
110
+
111
+ it "adds a '#' prefix to channel if it has no prefix" do
104
112
  subject.channel = "foo"
105
- expect( subject.channel ).to eql "#foo"
113
+ expect( subject.channel ).to eq "#foo"
106
114
  end
107
115
  end
108
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Sloan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-28 00:00:00.000000000 Z
11
+ date: 2014-04-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " A slim ruby wrapper for posting to slack webhooks "
14
14
  email: