matchi-fix 2.1.1 → 2.1.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
- data/README.md +1 -1
- data/lib/matchi/fix.rb +9 -4
- 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: 547d326ef94fd070ce52ea17e95d5f9a1de1821ffc469370a9dce1271295da4d
|
4
|
+
data.tar.gz: 11d030cc6082d07a41e0eacc81402d657328013874b39df928634ce80f41fd9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: daceccfb49e044c04361c08e13d03c5c451fcbb2f6bf9566fe14d9b9ac0cf4f12fae1af73e3563aaa8c2fc0aabd770d8665ecb8cfe1f7d29cf7cbc5771ab5c5f
|
7
|
+
data.tar.gz: 6c6a5dc3779629b8b9783b8df577d3c9a225b58dcbccdcd4efc5ca99f2e8b7248f41f2cbb7915b0b1ae7c9743f0c273a21400deed47198521c8b6d7f64ddab36
|
data/README.md
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
[](https://github.com/fixrb/matchi-fix/actions?query=workflow%3Arubocop+branch%3Amain)
|
7
7
|
[](https://github.com/fixrb/matchi-fix/raw/main/LICENSE.md)
|
8
8
|
|
9
|
-
> A [Fix](https://github.com/fixrb/fix)
|
9
|
+
> A [Fix](https://github.com/fixrb/fix) specing matcher compatible with [Matchi](https://github.com/fixrb/matchi).
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
data/lib/matchi/fix.rb
CHANGED
@@ -4,7 +4,7 @@ require "fix"
|
|
4
4
|
|
5
5
|
# Namespace for the Matchi library.
|
6
6
|
module Matchi
|
7
|
-
# **Fix** matcher.
|
7
|
+
# **Fix** specing matcher.
|
8
8
|
class Fix
|
9
9
|
# @return [#against] A set of specifications.
|
10
10
|
attr_reader :expected
|
@@ -28,14 +28,15 @@ module Matchi
|
|
28
28
|
# @param name [String, Symbol] The constant name of the specifications.
|
29
29
|
# @param block [Proc] A block of specifications.
|
30
30
|
def initialize(name = nil, &block)
|
31
|
-
@
|
31
|
+
@name = name
|
32
|
+
|
33
|
+
@expected = if unnamed?
|
32
34
|
raise ::ArgumentError, "Pass either an argument or a block" unless block
|
33
35
|
|
34
36
|
Fix(&block)
|
35
37
|
else
|
36
38
|
raise ::ArgumentError, "Can't pass both an argument and a block" if block
|
37
39
|
|
38
|
-
@name = name
|
39
40
|
::Fix[name]
|
40
41
|
end
|
41
42
|
end
|
@@ -83,8 +84,12 @@ module Matchi
|
|
83
84
|
|
84
85
|
private
|
85
86
|
|
87
|
+
def unnamed?
|
88
|
+
@name.nil?
|
89
|
+
end
|
90
|
+
|
86
91
|
def parameter
|
87
|
-
|
92
|
+
unnamed? ? "&specs" : ":#{@name}"
|
88
93
|
end
|
89
94
|
end
|
90
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matchi-fix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
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-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fix
|
@@ -150,7 +150,7 @@ dependencies:
|
|
150
150
|
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
|
-
description: A Fix
|
153
|
+
description: A Fix specing matcher compatible with Matchi.
|
154
154
|
email: contact@cyril.email
|
155
155
|
executables: []
|
156
156
|
extensions: []
|
@@ -181,5 +181,5 @@ requirements: []
|
|
181
181
|
rubygems_version: 3.1.6
|
182
182
|
signing_key:
|
183
183
|
specification_version: 4
|
184
|
-
summary: Fix
|
184
|
+
summary: Fix specing matcher.
|
185
185
|
test_files: []
|