quick-sampler 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/quick/sampler/dsl/simple_combinators.rb +11 -2
- data/lib/quick/sampler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ce420572de6ae77e74e2736e3501d5e9daf2953
|
4
|
+
data.tar.gz: 1ab7c6e1c3c11277e105a47befad9fe974fe760c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbb04b8b15840fcc0e12885d3b82e8757696b381acbbb787c80ce9953d818849d6d977873dc666e6f9757e605d9e01fb66992ac3ac24c3d7f845e8c4399a754b
|
7
|
+
data.tar.gz: 46d536fe6288ddfb8779b5b26131f4dfc813a61b6f9e76c24ccf37241e35b64aa008142f56eeab3b5c4fe7435adcc7da547f83bb3ad814dfc3518e20aa396d9c
|
@@ -52,8 +52,17 @@ module Quick
|
|
52
52
|
# @param [Integer, Range, Quick::Sampler<Intger>] size
|
53
53
|
# value to use as, range to pick from or sampler to sample from the list size
|
54
54
|
def list_of sampler, size: 1..10
|
55
|
-
size =
|
56
|
-
|
55
|
+
size = case size
|
56
|
+
when Quick::Sampler
|
57
|
+
size
|
58
|
+
when Range
|
59
|
+
pick_from(size)
|
60
|
+
when Numeric
|
61
|
+
const(size.to_i)
|
62
|
+
else
|
63
|
+
raise "Cant use #{size.inspect} as size"
|
64
|
+
end
|
65
|
+
feed { sampler.first(size.next) }
|
57
66
|
end
|
58
67
|
|
59
68
|
# Sampler of arbitrary nested structures made up of `Array`s, `Hash`es, `Quick::Sampler`s and
|