quick-sampler 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: fb39b55d1e1f2a633a7b3caae39a0f0908c4de9a
4
- data.tar.gz: 2e9d62fabcd8657a637fb1ea0b16946af929eee1
3
+ metadata.gz: 7f81ad0d5f37da0956dca3b19ec8734ae4ddb673
4
+ data.tar.gz: 12467152b7750200a431b2fb4a331687e37cf8b4
5
5
  SHA512:
6
- metadata.gz: 5182a2e7a859f535df1bfe10cc004efe6cef7beb59d124ee8e8275abcddb508cc092af3516bcc202f094279e9716a39316ed0dacadd3d7ae0e3568624e27f21c
7
- data.tar.gz: ba991af6e96aa6cfa743aadd4475a8b256c92d2f959c32de0e9a42597fd3e38dff4809471b2befc7cbd2c9cf4168a5af17d1bc067c089b5c092d0e90a80b2c43
6
+ metadata.gz: 33f9a893f91e642315d47e8b5b8f72b95fda8fdb3e9683f38ccda63e792547a5a97a0c341905e2977b7dcdca501e9a86a8eb2c6cc32fd918053c43883e2aa606
7
+ data.tar.gz: ab1d83d5bd017cff91ca39c285eba42c98878ba2e821019f6b24cbdfd1b5c166c667653a9a1e5b424c0ba7422266bfe8a7faa002a367d4dc966a350e032f0fb5
@@ -45,31 +45,17 @@ module Quick
45
45
 
46
46
  # Sampler of uniform arrays
47
47
  #
48
- # **Rosetta stone** the single argument version corresponds to QuickCheck's `listOf`.
49
- # Passing `non_empty: true` turns it into QuickCheck's `listOf1`.
50
- #
51
48
  # @return [Quick::Sampler]
52
49
  # a sampler that produces arrays of values sampled from its argument
53
50
  # @param [Quick::Sampler] sampler
54
51
  # a sampler to sample array elements from
52
+ # @param [Integer, Range, Quick::Sampler<Intger>] size
53
+ # value to use as, range to pick from or sampler to sample from the list size
55
54
  def list_of sampler, size: 1..10
55
+ size = pick_from(size) if Range === size
56
56
  send_to(sampler, :first, size)
57
57
  end
58
58
 
59
- # Sampler of uniform fixed size arrays
60
- #
61
- # **Rosetta stone** this sampler corresponds to QuickCheck's `vectorOf`.
62
- #
63
- # @return [Quick::Sampler]
64
- # a sampler that produces arrays of `size` of values sampled from `sampler`
65
- # @param [Integer] size
66
- # sample array size
67
- # @param [Quick::Sampler] sampler
68
- # a sampler to sample array elements from
69
- def vector_of size, sampler
70
- feed { sampler.take(size).force }
71
- end
72
-
73
59
  # Sampler of arbitrary nested structures made up of `Array`s, `Hash`es, `Quick::Sampler`s and
74
60
  # non-sampler values
75
61
  #
@@ -1,5 +1,5 @@
1
1
  module Quick
2
2
  module Sampler
3
- VERSION = "0.1.2"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quick-sampler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artem Baguinski