evt-schema-fixtures 0.0.0.2 → 0.0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/schema/fixtures/assignment.rb +23 -21
- 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: 266e456f9964b2c27ddc8f0b499b3466cdc34add1f8c6860260c85751ca66367
|
4
|
+
data.tar.gz: 7d810d1fbdacc719af7cce175e0e488fbbfd29aadb7f8619f331f48f7c22d673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73a983194205a73e64fd4fac3cffa08cb7a308a199ec5b387859d39f2112cca81e1a32e387c18638e3021f8868ac86853a759cdfea4bb4dbd2eaf6b5ed71ac9b
|
7
|
+
data.tar.gz: f4b4b29742ff0383807e0267d3dea8e5b9226cdb28edd4809aa700be7430fde6fe57027298fe3584a3003dd81b57ff93b82a1acfdf24b106838b0ba1a8d5f83f
|
@@ -19,6 +19,10 @@ module Schema
|
|
19
19
|
@attributes_context_name ||= 'Attributes'
|
20
20
|
end
|
21
21
|
|
22
|
+
def schema_class
|
23
|
+
comparison.control_class
|
24
|
+
end
|
25
|
+
|
22
26
|
initializer :comparison, na(:print_title_context), na(:title_context_name), na(:attributes_context_name)
|
23
27
|
|
24
28
|
def self.build(compare, attribute_names=nil, print_title_context: nil, title_context_name: nil, attributes_context_name: nil)
|
@@ -27,33 +31,31 @@ module Schema
|
|
27
31
|
new(comparison, print_title_context, title_context_name, attributes_context_name)
|
28
32
|
end
|
29
33
|
|
30
|
-
def call
|
31
|
-
schema_class = comparison.control_class
|
32
|
-
|
33
|
-
test_attributes = proc do
|
34
|
-
context attributes_context_name do
|
35
|
-
comparison.entries.each do |entry|
|
36
|
-
default_attribute_value = entry.control_value
|
37
|
-
attribute_value = entry.compare_value
|
38
|
-
|
39
|
-
test "#{entry.compare_name}" do
|
40
|
-
detail "Default Value: #{default_attribute_value.inspect}"
|
41
|
-
detail "Assigned Value: #{attribute_value.inspect}"
|
42
|
-
|
43
|
-
refute(attribute_value == default_attribute_value)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
34
|
+
def call
|
49
35
|
if print_title_context?
|
50
36
|
context "#{title_context_name}" do
|
51
37
|
detail "Class: #{schema_class.name}"
|
52
38
|
|
53
|
-
|
39
|
+
call!
|
54
40
|
end
|
55
41
|
else
|
56
|
-
|
42
|
+
call!
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def call!
|
47
|
+
context attributes_context_name do
|
48
|
+
comparison.entries.each do |entry|
|
49
|
+
default_attribute_value = entry.control_value
|
50
|
+
attribute_value = entry.compare_value
|
51
|
+
|
52
|
+
test "#{entry.compare_name}" do
|
53
|
+
detail "Default Value: #{default_attribute_value.inspect}"
|
54
|
+
detail "Assigned Value: #{attribute_value.inspect}"
|
55
|
+
|
56
|
+
refute(attribute_value == default_attribute_value)
|
57
|
+
end
|
58
|
+
end
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|