matchi 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/matchi/matcher/be_an_instance_of.rb +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a3c186895362318fd2c0497d3fb4b124b291a582d37ff16d02cb454f9dd52ca
|
4
|
+
data.tar.gz: 2fff123c60074a43feb8b81428d1dd61cb0d9e736e223531499113e794c2a2d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e61bb5d94221542d1b3c95e67d5616f90ffbb08a501edc997ed29bf57795a5ab398f2cb6f7edc59a32c9ed3482738246028e3ae35394c84788268fefc4b049
|
7
|
+
data.tar.gz: bec13c5814a7e007bbff9ae3f47ed3a3b162bc4fe26e5bf941a668fbb9310b7ef9de021dd85fa4fa89d4ef68f1c35bbf7572de0f6bcd799a951c115b6ed6f345
|
data/README.md
CHANGED
@@ -98,7 +98,7 @@ be_nil.matches? { nil } # => true
|
|
98
98
|
**Type/class** matcher:
|
99
99
|
|
100
100
|
```ruby
|
101
|
-
be_an_instance_of = Matchi::Matcher::BeAnInstanceOf.new(String)
|
101
|
+
be_an_instance_of = Matchi::Matcher::BeAnInstanceOf.new(:String)
|
102
102
|
be_an_instance_of.matches? { "foo" } # => true
|
103
103
|
```
|
104
104
|
|
@@ -11,10 +11,10 @@ module Matchi
|
|
11
11
|
# @example A string matcher
|
12
12
|
# Matchi::Matcher::BeAnInstanceOf.new(String)
|
13
13
|
#
|
14
|
-
# @param expected [
|
14
|
+
# @param expected [#to_s] The name of a module.
|
15
15
|
def initialize(expected)
|
16
16
|
super()
|
17
|
-
@expected = expected
|
17
|
+
@expected = self.class.const_get String(expected)
|
18
18
|
end
|
19
19
|
|
20
20
|
# Boolean comparison between the class of the actual value and the
|
@@ -24,6 +24,12 @@ module Matchi
|
|
24
24
|
# be_an_instance_of = Matchi::Matcher::BeInstanceOf.new(String)
|
25
25
|
# be_an_instance_of.matches? { "foo" } # => true
|
26
26
|
#
|
27
|
+
# be_an_instance_of = Matchi::Matcher::BeInstanceOf.new(:String)
|
28
|
+
# be_an_instance_of.matches? { "foo" } # => true
|
29
|
+
#
|
30
|
+
# be_an_instance_of = Matchi::Matcher::BeInstanceOf.new("String")
|
31
|
+
# be_an_instance_of.matches? { "foo" } # => true
|
32
|
+
#
|
27
33
|
# @yieldreturn [#class] the actual value to compare to the expected one.
|
28
34
|
#
|
29
35
|
# @return [Boolean] Comparison between actual and expected values.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matchi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
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-07-
|
11
|
+
date: 2021-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|