rx-rspec 0.4.1 → 0.4.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: 5ec713b68381116f5cd0dd29928c999f8e831176
4
- data.tar.gz: 41a63b49be631831293838c800c634fa5526a5d0
3
+ metadata.gz: 7c2ed45daec673571f059cbdb5b5083b0babebac
4
+ data.tar.gz: 95636b6f268a5658c203f9db4e6d5237f163c561
5
5
  SHA512:
6
- metadata.gz: 9ae42de39081fd07ec0cefeca36057110f8e61110e46e679337283e0167ff7e6a8a2e75dffc5df029506bf60939cb28bc1bcd476f6a682d4ed4af856d8e0874c
7
- data.tar.gz: fab1f1821c010e82aa29f8a1b8f63729f75a6dae62c66e5f4ebcc4eda7e61f36246c68e2ee2131fb14b1fc4738f7a103d913ce861ef6a4bdbc5099e53cb6e1b7
6
+ metadata.gz: 0f3f7eb8fdf01aa43d561992fbcb81a20ba15e64c37dee9551305be9aa627e965dc2af9cd4cb46232b4e4b20c0688fb28f74f7f82af5ebff1035576306e5a007
7
+ data.tar.gz: a766ddc2aa8c4ec993a6a52db15a17daa0880d777bfd883c7d0c9642631e9a97262f11b1f98ec688416aecc1bef39c27dec76d14e5f756728f53c770fff95d3c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rx-rspec (0.4.1)
4
+ rx-rspec (0.4.3)
5
5
  rx
6
6
 
7
7
  GEM
@@ -1,3 +1,4 @@
1
+ require 'rx-rspec/complete'
1
2
  require 'rx-rspec/error'
2
3
  require 'rx-rspec/exactly'
3
4
  require 'rx-rspec/first'
@@ -0,0 +1,27 @@
1
+ require 'rspec'
2
+ require 'rx-rspec/shared'
3
+
4
+ RSpec::Matchers.define :complete do
5
+ include RxRspec::Shared
6
+
7
+ match do |actual|
8
+ begin
9
+ @actual = await_done do |done|
10
+ actual.subscribe(
11
+ lambda { |_| },
12
+ lambda { |err| done.call(:error, err) },
13
+ lambda { done.call }
14
+ )
15
+ end
16
+ rescue Exception => err
17
+ @actual = [:error, err]
18
+ raise err
19
+ end
20
+ @actual.nil?
21
+ end
22
+
23
+ failure_message do
24
+ _, emitted = @actual
25
+ present_error(expected, emitted)
26
+ end
27
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'rx-rspec'
3
- spec.version = '0.4.1'
3
+ spec.version = '0.4.3'
4
4
  spec.summary = 'rspec testing support for RxRuby'
5
5
  spec.description = 'Writing specs for reactive streams is tricky both because of their asynchronous nature and because their next/error/completed semantics. The goal of rx-rspec is to provide powerful matchers that lets you express your expectations in a traditional rspec-like synchronous manner.'
6
6
  spec.authors = ['Anders Qvist']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rx-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anders Qvist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-03 00:00:00.000000000 Z
11
+ date: 2018-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rx
@@ -111,6 +111,7 @@ files:
111
111
  - README.md
112
112
  - lib/rx-rspec.rb
113
113
  - lib/rx-rspec/async_runner.rb
114
+ - lib/rx-rspec/complete.rb
114
115
  - lib/rx-rspec/error.rb
115
116
  - lib/rx-rspec/exactly.rb
116
117
  - lib/rx-rspec/first.rb