matchi-rspec 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/matchi/matcher/be_instance_of.rb +2 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1ff1b0da7768260dcf43db3e506d8fc8ed54b7518fd38c6b5aca65f36c186cb
|
4
|
+
data.tar.gz: f459d78d33ad4804000a6fea7b9b485cad402d9db07d85231046e5faf55c5705
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5d4ccce48f97eb034728c1ca522c1bae7893fda49bcd10a2c9bec9373d18a349b37e0e6bd1c1b6e97432168a468c5f10b64f633d468fd08674e3f5d6006e522
|
7
|
+
data.tar.gz: 9a0073dc12207e13feed3d855b63df39cb03459ed1ae2a2b05b4a4f8cbac4e68908ed392b299fd0795df6efb1a5fa7720334d83141c5fc5c8aac3cec52c71b6e
|
data/README.md
CHANGED
@@ -38,6 +38,9 @@ be.matches? { 42 } # => true
|
|
38
38
|
```ruby
|
39
39
|
be_instance_of = Matchi::Matcher::BeInstanceOf.new(String)
|
40
40
|
be_instance_of.matches? { "foo" } # => true
|
41
|
+
|
42
|
+
be_an_instance_of = Matchi::Matcher::BeAnInstanceOf.new(String)
|
43
|
+
be_an_instance_of.matches? { "foo" } # => true
|
41
44
|
```
|
42
45
|
|
43
46
|
**Equivalence** matcher:
|
@@ -19,20 +19,15 @@ module Matchi
|
|
19
19
|
@expected = expected
|
20
20
|
end
|
21
21
|
|
22
|
-
# @todo For security reasons, instead of comparing actual with expected,
|
23
|
-
# we should compare expected with actual. Using something such as:
|
24
|
-
# `expected.class_of?(actual)`.
|
25
|
-
#
|
26
22
|
# @example Is it an instance of string?
|
27
23
|
# be_instance_of = Matchi::Matcher::BeInstanceOf.new(String)
|
28
24
|
# be_instance_of.matches? { 'foo' } # => true
|
29
25
|
#
|
30
|
-
# @yieldreturn [#
|
31
|
-
# expected one.
|
26
|
+
# @yieldreturn [#class] the actual value to compare to the expected one.
|
32
27
|
#
|
33
28
|
# @return [Boolean] Comparison between actual and expected values.
|
34
29
|
def matches?
|
35
|
-
|
30
|
+
expected.equal?(yield.class)
|
36
31
|
end
|
37
32
|
end
|
38
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matchi-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Kato
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: matchi
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.
|
19
|
+
version: 2.0.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.
|
26
|
+
version: 2.0.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|