wisper-rspec 1.0.1 → 1.1.0

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: 268e596eab9231088d8620cb4861144b27abcfbc
4
- data.tar.gz: c62231ea01aeadb30c9bcb305132c0530a6fa635
3
+ metadata.gz: d3a4757d4ab7b0c3565660309b894a6033bd2117
4
+ data.tar.gz: 393331838cb5216f28690e760da75d29f73191c1
5
5
  SHA512:
6
- metadata.gz: 32406bb18486292a153cb43cec7fc5ff66dc6fa1e8b5293bed4d4aa2fa3349092ddf568a79c4c968c54c4d987ff8e938ce979596363bfb79ec4f075388f0d69b
7
- data.tar.gz: abaaad8515dad775db754daf227e53ab82f55c67f1867a1dbd1d4e42a52e5a4df2eb918597278ceec809533822e360e348c0051d63b65606e8f3c43035ded3af
6
+ metadata.gz: c8490dd30abb4a0cf4c6ae6b2736e42f7b0445e113ceb0b9289f976aedd71950d3e1ad35810892ba9685eb480e372ae920a58ea1c476979967553145b1dc1b1f
7
+ data.tar.gz: 3715c14f9fa2019da6f0fc8de7a0a773e51143c8fe01d7c9c35f6174db14f799300d325aff6c6a7fd13f08d534adf1d2042fe536a65708d1662fe98bc36116d2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,10 +1,17 @@
1
1
  Unreleased
2
2
 
3
+ 1.1.0 (15/May/2018)
4
+
5
+ Authors: Nikolai (nikolai-b), David Kennedy (TheTeaNerd)
6
+
7
+ * Add not_broadcast matcher (https://github.com/krisleech/wisper-rspec/pull/30)
8
+ * Doc fixes
9
+
3
10
  1.0.1 (24/Feb/2018)
4
11
 
5
12
  Authors: Kris Leech, Konstantin Rudy (k-ruby)
6
13
 
7
- * fixes: undefined method `id when using LoggerBoradcaster [#22]
14
+ * fixes: undefined method `id` when using LoggerBroadcaster [#22]
8
15
 
9
16
  1.0.0 (16/Sept/2017)
10
17
 
data/README.md CHANGED
@@ -62,10 +62,20 @@ expect {
62
62
 
63
63
  Note that the `broadcast` method is aliased as `publish`, similar to the *Wisper* library itself.
64
64
 
65
- ### Using message expections
65
+ ### Not broadcast matcher
66
+
67
+ If you want to assert a broadcast was not made you can use `not_broadcast` which is especially useful when chaining expectations.
68
+
69
+ ```ruby
70
+ expect {
71
+ publisher.execute(123)
72
+ }.to not_broadcast(:event, 99).and broadcast(:event, 123)
73
+ ```
74
+
75
+ ### Using message expectations
66
76
 
67
77
  If you need to assert on the listener receiving broadcast arguments you can subscribe a double
68
- with a [message expection](https://github.com/rspec/rspec-mocks#message-expectations)
78
+ with a [message expectation](https://github.com/rspec/rspec-mocks#message-expectations)
69
79
  and then use any of the [argument matchers](https://github.com/rspec/rspec-mocks#argument-matchers).
70
80
 
71
81
  ```ruby
@@ -120,3 +120,5 @@ module Wisper
120
120
  end
121
121
  end
122
122
  end
123
+
124
+ ::RSpec::Matchers.define_negated_matcher :not_broadcast, :broadcast
@@ -1,5 +1,5 @@
1
1
  module Wisper
2
2
  module Rspec
3
- VERSION = "1.0.1"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
@@ -4,6 +4,15 @@ RSpec::configure do |config|
4
4
  config.include(Wisper::RSpec::BroadcastMatcher)
5
5
  end
6
6
 
7
+ describe 'not_broadcast matcher' do
8
+ let(:publisher_class) { Class.new { include Wisper::Publisher } }
9
+ let(:publisher) { publisher_class.new }
10
+
11
+ it 'can be chained with broadcast' do
12
+ expect { publisher.send(:broadcast, :foobar) }.to not_broadcast(:barfoo).and broadcast(:foobar)
13
+ end
14
+ end
15
+
7
16
  describe 'broadcast matcher' do
8
17
  let(:publisher_class) { Class.new { include Wisper::Publisher } }
9
18
  let(:publisher) { publisher_class.new }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisper-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Leech
@@ -30,7 +30,7 @@ cert_chain:
30
30
  UktCshp/0fAPdyck9n64RkVTHYigKVbSGNJzpRW3CMD1EtRjr+cxS3nZ6zoelHo2
31
31
  6qhxRqhaOjky82Aa9KJPpMfdfJMImA8JmzIyuw==
32
32
  -----END CERTIFICATE-----
33
- date: 2018-02-14 00:00:00.000000000 Z
33
+ date: 2018-05-15 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description: Rspec matchers and stubbing for Wisper
36
36
  email:
metadata.gz.sig CHANGED
Binary file