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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 761d3a03fec25765835388735c0303a09e3756ac1d95ccf0ad46c769befb94bb
4
- data.tar.gz: 1d229c348a7bd6f0e85cb874f5337c584dc4f5a54815db6395ea4baf4ffc4eca
3
+ metadata.gz: e1ff1b0da7768260dcf43db3e506d8fc8ed54b7518fd38c6b5aca65f36c186cb
4
+ data.tar.gz: f459d78d33ad4804000a6fea7b9b485cad402d9db07d85231046e5faf55c5705
5
5
  SHA512:
6
- metadata.gz: f0e1291c5580a82b4d33b6d38ecb1235263fab75974ca512ee506f4ac27600f627bf5cd378822bf52247d54a4eac8e1cc20ff5ac8b43141a18686b029cd4fb77
7
- data.tar.gz: 8ca33e2bf90dfe34a2606ae3a68a155afdcdc3d32dffc7517473a24236286aaf16dc55d6e2b3fc7950c69ee8e114a098393908ecaade2aa9cdff59729eba9fd9
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 [#instance_of?] the actual value to compare to the
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
- yield.instance_of?(expected)
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.0
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-05-13 00:00:00.000000000 Z
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.1
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.1
26
+ version: 2.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement