randr 0.0.1 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbe094d6cf5059152d87186195a6836adfe7a854
4
- data.tar.gz: 085682b0a055447ec11868e7cc319c09fae1a341
3
+ metadata.gz: da6452463af6674dfc3023f136f37ccac8940f2e
4
+ data.tar.gz: 4e260335dff0765d0f8c0e4518e61f82685df99a
5
5
  SHA512:
6
- metadata.gz: d10569d97cd3f299d914c9f62448001184aff8abb7948c038c7246cfcd16dddd35386914795a4224c47b91ac9512f06c661507bca31ba46c38f530c0170045e6
7
- data.tar.gz: 478f530296d03d46d2f2c23cb7176236f383f0268475533f5eecc8f37d0f7cbb9639e718ff146d746a9766deccf5c98ab7b157838ecc4666ce9da069524ad1f7
6
+ metadata.gz: 68bb054c65ed78a5c06c5600dc609223e76a48518075525ea90facf28b43b22684a883f1ae146d45e30abb7a1984802fd8eb8e60cff0646619638598cf631589
7
+ data.tar.gz: bb73185c454663488c47d1aab61454aee3f807e873f28546d4013e6411ed2dfbbd8dce708c07cdf10530f6247d4bdfc445824c14bbbce2d009f8a5a950ed791f
data/lib/randr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Randr
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,29 @@
1
+ require_relative "test_helper"
2
+ require "randr"
3
+ require "test/unit"
4
+
5
+ class TestGenerator < Test::Unit::TestCase
6
+
7
+ def setup
8
+ @gen = Randr::Generator.new
9
+ end
10
+
11
+ def test_generates_sequences
12
+ 10.times do
13
+ a = Random.rand(100)
14
+ b = Random.rand(100) + 100
15
+ c = Random.rand(20)
16
+
17
+ result = @gen.times(c).from(a).to(b)
18
+
19
+ assert_equal result.size, c
20
+
21
+ result.each do |num|
22
+ assert num >= a
23
+ assert num <= b
24
+ end
25
+
26
+ end
27
+ end
28
+
29
+ end
@@ -0,0 +1 @@
1
+ $LOAD_PATH << File.expand_path(File.dirname(__FILE__) + "/../lib")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: randr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignacio Contreras Pinilla
@@ -53,6 +53,8 @@ files:
53
53
  - lib/randr.rb
54
54
  - lib/randr/version.rb
55
55
  - randr.gemspec
56
+ - test/test_generator.rb
57
+ - test/test_helper.rb
56
58
  homepage: http://github.com/ignc/randr
57
59
  licenses:
58
60
  - MIT
@@ -77,4 +79,6 @@ rubygems_version: 2.0.14
77
79
  signing_key:
78
80
  specification_version: 4
79
81
  summary: Simple wrapper for the Random class
80
- test_files: []
82
+ test_files:
83
+ - test/test_generator.rb
84
+ - test/test_helper.rb