randr 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/randr/version.rb +1 -1
- data/test/test_generator.rb +29 -0
- data/test/test_helper.rb +1 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da6452463af6674dfc3023f136f37ccac8940f2e
|
4
|
+
data.tar.gz: 4e260335dff0765d0f8c0e4518e61f82685df99a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68bb054c65ed78a5c06c5600dc609223e76a48518075525ea90facf28b43b22684a883f1ae146d45e30abb7a1984802fd8eb8e60cff0646619638598cf631589
|
7
|
+
data.tar.gz: bb73185c454663488c47d1aab61454aee3f807e873f28546d4013e6411ed2dfbbd8dce708c07cdf10530f6247d4bdfc445824c14bbbce2d009f8a5a950ed791f
|
data/lib/randr/version.rb
CHANGED
@@ -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
|
data/test/test_helper.rb
ADDED
@@ -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.
|
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
|