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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 168258c942f6e9390a6bc6ad65112de3acbcd835438a750dd1dc4692e256db6d
4
- data.tar.gz: 8b64c5cbdf54f665f1982cb9e8d44a16685904b626680e22cab80969304108be
3
+ metadata.gz: 5a3c186895362318fd2c0497d3fb4b124b291a582d37ff16d02cb454f9dd52ca
4
+ data.tar.gz: 2fff123c60074a43feb8b81428d1dd61cb0d9e736e223531499113e794c2a2d0
5
5
  SHA512:
6
- metadata.gz: 40d8993bb7bae28eff3ef0d86d4d8e9dc51f36195466fa3f3016c4f1c52dfccac27e0eb02c18c1f34a4c4f2df16a8ba566c89633e2da7d595ad433ac4e03563f
7
- data.tar.gz: d2e8b2cbb554f76cf9a0e25dbbf41e591d962ed3e1af7c64d5de84d823e86fc317e3d76e174d4f559f526022aa6afcf1e1411200b4789821d7ffc8917b7e4e3d
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 [Class] An expected class.
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.1.1
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-14 00:00:00.000000000 Z
11
+ date: 2021-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler