regtest 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +4 -0
- data/Rakefile +1 -1
- data/lib/regtest.rb +27 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 343e3f6247f912e2c9f8e2b3262caa2c2b8beb72
|
4
|
+
data.tar.gz: 2c1678dc4ce5ddce32eae6978697052247c84d43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8a7f7b43d635e98a95bff01adad429a4b3b52752dfbdc9289fd8c0dcb4a1e400c8b849fc024cad07119eec7ec477df6c463454c1c61ff0c4a17cd3dae536ce6
|
7
|
+
data.tar.gz: f9c04ec27a23e8bf1f6ccc579e2b95004dd8ec9975ab67948c8d02ea4730ba813fceeabecf59e371ed5e936d8086b769269e7579412243a8358101f2449c08d6
|
data/Changelog
CHANGED
data/Rakefile
CHANGED
data/lib/regtest.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
#
|
2
2
|
# Regtest - Simple Regression Testing For Ruby Projects
|
3
3
|
#
|
4
|
-
# Copyright 2014 by Jan Friedrich (janfri26@gmail.com)
|
4
|
+
# Copyright 2014, 2015 by Jan Friedrich (janfri26@gmail.com)
|
5
5
|
# License: Regtest is licensed under the same terms as Ruby itself.
|
6
6
|
#
|
7
7
|
|
8
|
+
require 'ostruct'
|
8
9
|
require 'yaml'
|
9
10
|
|
10
11
|
module Regtest
|
@@ -33,11 +34,35 @@ module Regtest
|
|
33
34
|
print '.'; $stdout.flush
|
34
35
|
end
|
35
36
|
|
37
|
+
# Build all combinations of a Hash-like object with arrays as values.
|
38
|
+
# Return value is an array of OpenStruct instances.
|
39
|
+
#
|
40
|
+
# Example:
|
41
|
+
# require 'ostruct'
|
42
|
+
# o = OpenStruct.new
|
43
|
+
# o.a = [1,2,3]
|
44
|
+
# o.b = [:x, :y]
|
45
|
+
# Regtest.combinations(o).map(&:to_h) # => [{:a=>1, :b=>:x}, {:a=>1, :b=>:y}, {:a=>2, :b=>:x}, {:a=>2, :b=>:y}, {:a=>3, :b=>:x}, {:a=>3, :b=>:y}]
|
46
|
+
#
|
47
|
+
def combinations hashy
|
48
|
+
h = hashy.to_h
|
49
|
+
a = h[h.keys[0]].product(*h.values[1..-1])
|
50
|
+
res = []
|
51
|
+
a.each do |e|
|
52
|
+
o = OpenStruct.new
|
53
|
+
h.keys.zip(e) do |k, v|
|
54
|
+
o[k] = v
|
55
|
+
end
|
56
|
+
res << o
|
57
|
+
end
|
58
|
+
res
|
59
|
+
end
|
60
|
+
|
36
61
|
class << self
|
37
62
|
attr_accessor :count, :results, :start
|
38
63
|
end
|
39
64
|
|
40
|
-
module_function :sample
|
65
|
+
module_function :sample, :combinations
|
41
66
|
|
42
67
|
end
|
43
68
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: regtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Friedrich
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rim
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2.
|
19
|
+
version: '2.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2.
|
26
|
+
version: '2.6'
|
27
27
|
description: Regression testing in Ruby.
|
28
28
|
email: janfri26@gmail.com
|
29
29
|
executables: []
|
@@ -55,8 +55,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubyforge_project:
|
58
|
-
rubygems_version: 2.
|
58
|
+
rubygems_version: 2.5.0
|
59
59
|
signing_key:
|
60
60
|
specification_version: 4
|
61
61
|
summary: Regression testing in Ruby.
|
62
62
|
test_files: []
|
63
|
+
has_rdoc:
|