shape_of 0.0.2 → 0.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 +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 200845fd006ae0119d06f0b1f3f8b7b908a7c3d8f8c16ebe4856bcb905af5763
|
4
|
+
data.tar.gz: f046ee908eb3715e8028484dac72fa0fa411f24496ad3d71d8c984cf1a33fd7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9d8e53319be78d4f3cf0aa6cc94f19f89c25decc737fecd1d16ce6e4666f35b80bca6ee9aff753ada64e85aa9d8c829cb4af06d67b33c114033c6f57838258a
|
7
|
+
data.tar.gz: d70f5abeb46bd372329189755f901f5d56fa0e9d7d07d3a6724404719844c08ae4792042e6eaf417051e0bf33183f66f23fe29369003eefc0d6f7879157f9756
|
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
|