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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rx-rspec.rb +1 -0
- data/lib/rx-rspec/complete.rb +27 -0
- data/rx-rspec.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c2ed45daec673571f059cbdb5b5083b0babebac
|
4
|
+
data.tar.gz: 95636b6f268a5658c203f9db4e6d5237f163c561
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f3f7eb8fdf01aa43d561992fbcb81a20ba15e64c37dee9551305be9aa627e965dc2af9cd4cb46232b4e4b20c0688fb28f74f7f82af5ebff1035576306e5a007
|
7
|
+
data.tar.gz: a766ddc2aa8c4ec993a6a52db15a17daa0880d777bfd883c7d0c9642631e9a97262f11b1f98ec688416aecc1bef39c27dec76d14e5f756728f53c770fff95d3c
|
data/Gemfile.lock
CHANGED
data/lib/rx-rspec.rb
CHANGED
@@ -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
|
data/rx-rspec.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'rx-rspec'
|
3
|
-
spec.version = '0.4.
|
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.
|
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-
|
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
|