signal 0.2.1 → 0.2.2

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: 59c367a4af5c147250796ec4ac97b8e07a7e9a2f
4
- data.tar.gz: a011171826f8920edee520058073481a1ae7aafb
3
+ metadata.gz: 4bab949237a86fb74f7d3d89ce215a614f87f725
4
+ data.tar.gz: cc343238a6eacaa010c910ebff962729baa62f30
5
5
  SHA512:
6
- metadata.gz: f2ce9e011e335d2a20b867b89f51d0827b0d015f7f3e264b804693e080eaf59174a5b24ca1dca6f89852fa16d7a496aa886d34e77f50aba2dfabf55979e41acf
7
- data.tar.gz: d73936c50a0618a2fea021850f711a36b95279a98e92d7696ac059286ea870211d21411e065bbe25e7e06a66b3e0c002ef0c69a323a54063b743877c2c93f5e2
6
+ metadata.gz: 1358d2e51f6f5fb757fdad35e74325adc15be310d6a1b56ea7dd432b7861afee4ffd2b32fbe41d473bd8335eb39b11d7957ce29fb587cdfdbb7012e191c34034
7
+ data.tar.gz: 55b1bd38fbb3b9ac9eb10c29feb6f3cfb5bf4116e30400e91da211571661080132ba3edd5bbd780139747c0271fcc9497e5bd1c15e717d810f2b66743210cf10
@@ -38,7 +38,7 @@ module Signal
38
38
  def emit_signal(type, event, *args)
39
39
  listeners.each do |listener|
40
40
  method_name = "#{type}_#{event}"
41
- listener.send(method_name, *args) if listener.respond_to?(method_name)
41
+ listener.send(method_name, *args) if listener.respond_to?(method_name, true)
42
42
  end
43
43
  end
44
44
  end
@@ -1,3 +1,3 @@
1
1
  module Signal
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -105,4 +105,19 @@ describe Signal do
105
105
  observable.emit(:ready, 1, 2, 3)
106
106
  end
107
107
  end
108
+
109
+ context 'mixed listeners' do
110
+ it 'calls all listeners' do
111
+ callable.respond_to(:on_ready)
112
+ another_callable = Callable.new
113
+
114
+ expect(callable).to receive(:called).ordered
115
+ expect(another_callable).to receive(:called).ordered
116
+
117
+ observable
118
+ .add_listener(callable)
119
+ .on(:ready, &another_callable)
120
+ .emit(:ready)
121
+ end
122
+ end
108
123
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: signal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-09 00:00:00.000000000 Z
11
+ date: 2015-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord