lib/reactor/testing/matchers.rb in reactor-0.2.10 vs lib/reactor/testing/matchers.rb in reactor-0.3.0
- old
+ new
@@ -21,6 +21,14 @@
value.should == expected[key]
end
end
block.call
end
+end
+
+RSpec::Matchers.define :subscribe_to do |name, data = {}, &expectations|
+
+ match do
+ expectations.call if expectations.present?
+ Reactor::Event.publish(name, data)
+ end
end
\ No newline at end of file