test-unit 3.4.9 → 3.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +7 -0
- data/lib/test/unit/data-sets.rb +14 -9
- data/lib/test/unit/data.rb +2 -2
- data/lib/test/unit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d7f5b0dc45031fefcdfb3041dfdc747c92eeaecd992cca117e151e4cac580d2
|
4
|
+
data.tar.gz: b3473fdb9cea9212e89b5c35cfe6ecee43f2c4efd1c69b5ed7bc9c1d97278b23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ff80ac0c8e57c424769c1bc393bee079525b6e589e9b81e9aca09915336d63d285e0a26278b6f904c68d87f59c0e6f23231226132440a45dc4b4d05e341401a
|
7
|
+
data.tar.gz: d801dfe17d358768d30711e53c8d27530f9aa46623d44829d839e8c3129351bd3d6ac5fd594fb9a726d21f7657773fd6dcd94c77cf964392a23fda1056245dc3
|
data/doc/text/news.md
CHANGED
data/lib/test/unit/data-sets.rb
CHANGED
@@ -22,17 +22,16 @@ module Test
|
|
22
22
|
add(data_set)
|
23
23
|
end
|
24
24
|
|
25
|
+
def have_keep?
|
26
|
+
each_data_set do |_, options|
|
27
|
+
return true if options[:keep]
|
28
|
+
end
|
29
|
+
false
|
30
|
+
end
|
31
|
+
|
25
32
|
def keep
|
26
33
|
new_data_sets = self.class.new
|
27
|
-
|
28
|
-
block = lambda do |(data_set, options)|
|
29
|
-
yielder << [data_set, options]
|
30
|
-
end
|
31
|
-
@procs.each(&block)
|
32
|
-
@variables.each(&block)
|
33
|
-
@value_sets.each(&block)
|
34
|
-
end
|
35
|
-
all_data_sets.each do |data_set, options|
|
34
|
+
each_data_set do |data_set, options|
|
36
35
|
next if options.nil?
|
37
36
|
next unless options[:keep]
|
38
37
|
new_data_sets.add(data_set, options)
|
@@ -79,6 +78,12 @@ module Test
|
|
79
78
|
end
|
80
79
|
|
81
80
|
private
|
81
|
+
def each_data_set(&block)
|
82
|
+
@procs.each(&block)
|
83
|
+
@variables.each(&block)
|
84
|
+
@value_sets.each(&block)
|
85
|
+
end
|
86
|
+
|
82
87
|
def each_pattern(variables)
|
83
88
|
grouped_variables = variables.group_by do |_, options|
|
84
89
|
options[:group]
|
data/lib/test/unit/data.rb
CHANGED
@@ -170,11 +170,11 @@ module Test
|
|
170
170
|
options ||= {}
|
171
171
|
data_sets = current_attribute(:data)[:value] || DataSets.new
|
172
172
|
data_sets.add(data_set, options)
|
173
|
-
if options[:keep]
|
173
|
+
if options[:keep] or data_sets.have_keep?
|
174
174
|
keep_hook = lambda do |attr|
|
175
175
|
attr.merge(value: attr[:value].keep)
|
176
176
|
end
|
177
|
-
options = options.merge(keep_hook: keep_hook)
|
177
|
+
options = options.merge(keep: true, keep_hook: keep_hook)
|
178
178
|
end
|
179
179
|
attribute(:data, data_sets, options)
|
180
180
|
end
|
data/lib/test/unit/version.rb
CHANGED