matchi-rspec 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -3
- data.tar.gz.sig +0 -0
- data/README.md +4 -12
- data/VERSION.semver +1 -1
- data/lib/matchi/rspec/be.rb +14 -0
- data/lib/matchi/rspec/be_instance_of.rb +16 -1
- data/lib/matchi/rspec/eq.rb +14 -0
- data/matchi-fix.gemspec +3 -3
- metadata +7 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebfbc1db52aaa40ce092cba54aa2e5766da75092
|
4
|
+
data.tar.gz: 4af7b692f438d80a2e6a79841d2e643d77416db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5118260f1e9f2eab112e928ac71ed28efa1aff839152fb62aa83db138a1a57109e50fa83eb3217afed7b3290e372dab257797f57e4c5a5d327d1e772e307082
|
7
|
+
data.tar.gz: 495c08909ca82f2cd24389eb291b1cbab55a318add23d1b71e3b56a17808dde78912dcc512718135587e5d594b9c6a9f87954bd4df81b097c5e199fbcf20e009
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
��-�v�����*�G�LGp�U
|
2
|
+
�-�hz�(�.;����}� ��eH�S"���S&���ԥ��z�q�NK�ֽ�Nc�0O��a��8t���6-�"�&�n��r�Y",$�c�9Q�V��
|
3
|
+
,�@Mf�QJ��tF��r��FAG;r6��W!2$��2�Gc�v ��Go1�ށ�P'���c��43<��E �A�g���ŷَ2メ��'�7آ%2���QK4,���sO�5��?�U
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
[][inchpages]
|
6
6
|
[][rubydoc]
|
7
7
|
|
8
|
-
> Extend Matchi matchers with [RSpec](http://rspec.info/)'s ones.
|
8
|
+
> Extend [Matchi](https://github.com/fixrb/matchi) matchers with some [RSpec](http://rspec.info/)'s ones.
|
9
9
|
|
10
10
|
## Contact
|
11
11
|
|
@@ -32,32 +32,24 @@ The `HighSecurity` trust profile will verify all gems. All of __Matchi::Rspec__
|
|
32
32
|
|
33
33
|
## Usage
|
34
34
|
|
35
|
-
### List all matchers
|
36
|
-
|
37
|
-
```ruby
|
38
|
-
Matchi.constants # => [:BeFalse, :BeNil, :BeTrue, :Eql, :Equal, :Match, :RaiseException, :Be, :BeInstanceOf, :Eq]
|
39
|
-
```
|
40
|
-
|
41
|
-
### Built-in RSpec matchers
|
42
|
-
|
43
35
|
**Identity** matcher:
|
44
36
|
|
45
37
|
```ruby
|
46
|
-
be = Matchi.
|
38
|
+
be = Matchi::Be.new(42)
|
47
39
|
be.matches? { 42 } # => true
|
48
40
|
```
|
49
41
|
|
50
42
|
**Type/class** matcher:
|
51
43
|
|
52
44
|
```ruby
|
53
|
-
be_instance_of = Matchi.
|
45
|
+
be_instance_of = Matchi::BeInstanceOf.new(String)
|
54
46
|
be_instance_of.matches? { 'foo' } # => true
|
55
47
|
```
|
56
48
|
|
57
49
|
**Equivalence** matcher:
|
58
50
|
|
59
51
|
```ruby
|
60
|
-
eq = Matchi.
|
52
|
+
eq = Matchi::Eq.new('foo')
|
61
53
|
eq.matches? { 'foo' } # => true
|
62
54
|
```
|
63
55
|
|
data/VERSION.semver
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/lib/matchi/rspec/be.rb
CHANGED
@@ -2,5 +2,19 @@
|
|
2
2
|
module Matchi
|
3
3
|
# **Identity** matcher.
|
4
4
|
class Be < Equal
|
5
|
+
# Returns a string representing the matcher.
|
6
|
+
#
|
7
|
+
# @return [String] A string representing the matcher.
|
8
|
+
def to_s
|
9
|
+
"be #{@expected.inspect}"
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns a hash of one key-value pair with a key corresponding to the
|
13
|
+
# matcher and a value corresponding to its initialize parameters.
|
14
|
+
#
|
15
|
+
# @return [Hash] A hash of one key-value pair.
|
16
|
+
def to_h
|
17
|
+
{ Be: [@expected] }
|
18
|
+
end
|
5
19
|
end
|
6
20
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Namespace for the Matchi library.
|
2
2
|
module Matchi
|
3
3
|
# **Type/class** matcher.
|
4
|
-
class BeInstanceOf
|
4
|
+
class BeInstanceOf
|
5
5
|
# Initialize the matcher with an object.
|
6
6
|
#
|
7
7
|
# @example A string matcher
|
@@ -23,5 +23,20 @@ module Matchi
|
|
23
23
|
def matches?
|
24
24
|
yield.instance_of?(@expected)
|
25
25
|
end
|
26
|
+
|
27
|
+
# Returns a string representing the matcher.
|
28
|
+
#
|
29
|
+
# @return [String] A string representing the matcher.
|
30
|
+
def to_s
|
31
|
+
"be_instance_of #{@expected.inspect}"
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns a hash of one key-value pair with a key corresponding to the
|
35
|
+
# matcher and a value corresponding to its initialize parameters.
|
36
|
+
#
|
37
|
+
# @return [Hash] A hash of one key-value pair.
|
38
|
+
def to_h
|
39
|
+
{ BeInstanceOf: [@expected] }
|
40
|
+
end
|
26
41
|
end
|
27
42
|
end
|
data/lib/matchi/rspec/eq.rb
CHANGED
@@ -2,5 +2,19 @@
|
|
2
2
|
module Matchi
|
3
3
|
# **Equivalence** matcher.
|
4
4
|
class Eq < Eql
|
5
|
+
# Returns a string representing the matcher.
|
6
|
+
#
|
7
|
+
# @return [String] A string representing the matcher.
|
8
|
+
def to_s
|
9
|
+
"eq #{@expected.inspect}"
|
10
|
+
end
|
11
|
+
|
12
|
+
# Returns a hash of one key-value pair with a key corresponding to the
|
13
|
+
# matcher and a value corresponding to its initialize parameters.
|
14
|
+
#
|
15
|
+
# @return [Hash] A hash of one key-value pair.
|
16
|
+
def to_h
|
17
|
+
{ Eq: [@expected] }
|
18
|
+
end
|
5
19
|
end
|
6
20
|
end
|
data/matchi-fix.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |spec|
|
|
4
4
|
spec.authors = ['Cyril Wack']
|
5
5
|
spec.email = ['contact@cyril.email']
|
6
6
|
|
7
|
-
spec.summary = "Extend Matchi matchers with RSpec's ones."
|
8
|
-
spec.description = 'Matchi extension gem to provide
|
7
|
+
spec.summary = "Extend Matchi matchers with some RSpec's ones."
|
8
|
+
spec.description = 'Matchi extension gem to provide some RSpec matchers.'
|
9
9
|
spec.homepage = 'https://github.com/fixrb/matchi-rspec'
|
10
10
|
spec.license = 'MIT'
|
11
11
|
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
15
15
|
spec.require_paths = ['lib']
|
16
16
|
|
17
|
-
spec.add_dependency 'matchi', '~> 0.
|
17
|
+
spec.add_dependency 'matchi', '~> 0.1.2'
|
18
18
|
|
19
19
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
20
20
|
spec.add_development_dependency 'rake', '~> 10.4'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matchi-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Wack
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
|
31
31
|
0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-10-
|
33
|
+
date: 2015-10-31 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: matchi
|
@@ -38,14 +38,14 @@ dependencies:
|
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 0.1.2
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 0.1.2
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: bundler
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
- - "~>"
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0.34'
|
119
|
-
description: Matchi extension gem to provide
|
119
|
+
description: Matchi extension gem to provide some RSpec matchers.
|
120
120
|
email:
|
121
121
|
- contact@cyril.email
|
122
122
|
executables: []
|
@@ -166,9 +166,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
166
|
version: '0'
|
167
167
|
requirements: []
|
168
168
|
rubyforge_project:
|
169
|
-
rubygems_version: 2.4.5
|
169
|
+
rubygems_version: 2.4.5
|
170
170
|
signing_key:
|
171
171
|
specification_version: 4
|
172
|
-
summary: Extend Matchi matchers with RSpec's ones.
|
172
|
+
summary: Extend Matchi matchers with some RSpec's ones.
|
173
173
|
test_files: []
|
174
174
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|