evt-schema-fixtures 0.0.0.1 → 1.0.0.0
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
- data/lib/schema/fixtures/equality.rb +34 -31
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccd5470add57e63482e080c406b6b8ea28cfd0c145d064166591841cd51eb520
|
4
|
+
data.tar.gz: dc1f9660049c115f5113ab53f3a2df9957ac7a68a3ac51404350dbad003c125f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2f75ee2c3cdd8e283eaacba6c2d4ac0616637f6dc447df3caf6c08a0851c7c91befe477160f619c1b98b786bb32dc9d8417afd8c4ae242044c72a0b6ce7dde9
|
7
|
+
data.tar.gz: 637789888a210d147d6175fafb52a6aaaaaeb873e084053821f30178020f14f45f8055fe0cfc1b1c9a926e625d9a90ba350ebe9d97ae999753e4db2c49c0d203
|
@@ -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
|
@@ -23,6 +23,14 @@ module Schema
|
|
23
23
|
@attributes_context_name ||= 'Attributes'
|
24
24
|
end
|
25
25
|
|
26
|
+
def control_class
|
27
|
+
comparison.control_class
|
28
|
+
end
|
29
|
+
|
30
|
+
def compare_class
|
31
|
+
comparison.compare_class
|
32
|
+
end
|
33
|
+
|
26
34
|
initializer :comparison, na(:ignore_class), na(:print_title_context), na(:title_context_name), na(:attributes_context_name)
|
27
35
|
|
28
36
|
def self.build(control, compare, attribute_names=nil, ignore_class: nil, print_title_context: nil, title_context_name: nil, attributes_context_name: nil)
|
@@ -30,45 +38,40 @@ module Schema
|
|
30
38
|
new(comparison, ignore_class, print_title_context, title_context_name, attributes_context_name)
|
31
39
|
end
|
32
40
|
|
33
|
-
def call
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
context attributes_context_name do
|
39
|
-
comparison.entries.each do |entry|
|
40
|
-
printed_attribute_name = Attribute.printed_name(entry)
|
41
|
-
|
42
|
-
control_attribute_value = entry.control_value
|
43
|
-
compare_attribute_value = entry.compare_value
|
41
|
+
def call
|
42
|
+
if print_title_context?
|
43
|
+
context "#{title_context_name}" do
|
44
|
+
detail "Control Class: #{control_class.name}"
|
45
|
+
detail "Compare Class: #{compare_class.name}"
|
44
46
|
|
45
|
-
|
46
|
-
|
47
|
-
|
47
|
+
call!
|
48
|
+
end
|
49
|
+
else
|
50
|
+
call!
|
51
|
+
end
|
52
|
+
end
|
48
53
|
|
49
|
-
|
50
|
-
|
51
|
-
|
54
|
+
def call!
|
55
|
+
if not ignore_class?
|
56
|
+
test "Classes are the same" do
|
57
|
+
assert(control_class == compare_class)
|
52
58
|
end
|
53
59
|
end
|
54
60
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
detail "Compare Class: #{compare_class.name}"
|
61
|
+
context attributes_context_name do
|
62
|
+
comparison.entries.each do |entry|
|
63
|
+
printed_attribute_name = Attribute.printed_name(entry)
|
59
64
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
detail '
|
66
|
-
end
|
65
|
+
control_attribute_value = entry.control_value
|
66
|
+
compare_attribute_value = entry.compare_value
|
67
|
+
|
68
|
+
test printed_attribute_name do
|
69
|
+
detail "#{control_class.name.split('::').last} Value: #{control_attribute_value.inspect}"
|
70
|
+
detail "#{compare_class.name.split('::').last} Value: #{compare_attribute_value.inspect}"
|
67
71
|
|
68
|
-
|
72
|
+
assert(compare_attribute_value == control_attribute_value)
|
73
|
+
end
|
69
74
|
end
|
70
|
-
else
|
71
|
-
test_attributes.()
|
72
75
|
end
|
73
76
|
end
|
74
77
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evt-schema-fixtures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0
|
4
|
+
version: 1.0.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- The Eventide Project
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-08-
|
11
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-schema
|