shape_of 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shape_of.rb +6 -6
- 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: 0f32c3530c617efc49481f9e952d30996e62b429f591f28bad0b9c9bfaa161da
|
4
|
+
data.tar.gz: b33c421e8bfac97b74e58970a7cacd6eb4ccc55c60637a5410ba4f688286a1a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bc0af5a46a7a8285ecebd29f76c2146032043346cc4604750835521f885062662732129fb807ea7059d815d9f90571abab52d3b84764a5886268303f1ed9882
|
7
|
+
data.tar.gz: d18852f3ba98bfde393ad39466d4860b0c6eff6aa643d16fb237dba4170b1c46a5fd11abcb7cbbe3450376e7f8ba4799f075b9339c6dfeab8f70cc689189494e
|
data/lib/shape_of.rb
CHANGED
@@ -89,11 +89,11 @@ module ShapeOf
|
|
89
89
|
module Assertions
|
90
90
|
def assert_shape_of(object, shape)
|
91
91
|
if shape.respond_to? :shape_of?
|
92
|
-
|
92
|
+
assert_operator shape, :shape_of?, object
|
93
93
|
elsif shape.instance_of? ::Array
|
94
|
-
|
94
|
+
assert_operator Array[shape.first], :shape_of?, object
|
95
95
|
elsif shape.instance_of? ::Hash
|
96
|
-
|
96
|
+
assert_operator Hash[shape], :shape_of?, object
|
97
97
|
else
|
98
98
|
raise TypeError, "Expected #{Shape.inspect}, an #{::Array.inspect}, or a #{::Hash.inspect} as the shape"
|
99
99
|
end
|
@@ -101,11 +101,11 @@ module ShapeOf
|
|
101
101
|
|
102
102
|
def refute_shape_of(object, shape)
|
103
103
|
if shape.respond_to? :shape_of?
|
104
|
-
|
104
|
+
refute_operator shape, :shape_of?, object
|
105
105
|
elsif shape.instance_of? ::Array
|
106
|
-
|
106
|
+
refute_operator Array[shape.first], :shape_of?, object
|
107
107
|
elsif shape.instance_of? ::Hash
|
108
|
-
|
108
|
+
refute_operator Hash[shape], :shape_of?, object
|
109
109
|
else
|
110
110
|
raise TypeError, "Expected #{Shape.inspect}, an #{::Array.inspect}, or a #{::Hash.inspect} as the shape"
|
111
111
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shape_of
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Isom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-05-
|
11
|
+
date: 2021-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|