evt-schema-fixtures 0.0.0.1 → 0.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/schema/fixtures/equality.rb +36 -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: 4aba8e6d289ada91eb6a816228e671406c452d44aadc81ca93436f524e4ce4eb
|
4
|
+
data.tar.gz: 42b67a76d1e6e6313b24ed1c94e81abc58422df18c3578963582333c60663f31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fce286c690fc11f9b9fbcb0fec7e0b0f7a8db95bc050eee499d8c9cbf5a9c663a4010490b0e24f64718346f760c4bf798892789c3f31519ef5c75e98a0acb70
|
7
|
+
data.tar.gz: eeefc8f33ff316b579db3ee86353b19d5c9a14bfed9bd184ccf1954dab3c29077063733bbf3f7603b51e17363e3189f4bf71f597e8b4649b4223c5d966f520ae
|
@@ -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,42 @@ 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
|
-
control_class = comparison.control_class
|
35
|
-
compare_class = comparison.compare_class
|
36
|
-
|
37
|
-
test_attributes = proc do
|
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
|
44
|
-
|
45
|
-
test printed_attribute_name do
|
46
|
-
detail "#{control_class.name.split('::').last} Value: #{control_attribute_value.inspect}"
|
47
|
-
detail "#{compare_class.name.split('::').last} Value: #{compare_attribute_value.inspect}"
|
48
|
-
|
49
|
-
assert(compare_attribute_value == control_attribute_value)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
41
|
+
def call
|
55
42
|
if print_title_context?
|
56
43
|
context "#{title_context_name}" do
|
57
44
|
detail "Control Class: #{control_class.name}"
|
58
45
|
detail "Compare Class: #{compare_class.name}"
|
59
46
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
47
|
+
call!
|
48
|
+
end
|
49
|
+
else
|
50
|
+
call!
|
51
|
+
end
|
52
|
+
end
|
67
53
|
|
68
|
-
|
54
|
+
def call!
|
55
|
+
if not ignore_class?
|
56
|
+
test "Classes are the same" do
|
57
|
+
assert(control_class == compare_class)
|
69
58
|
end
|
70
59
|
else
|
71
|
-
|
60
|
+
detail 'Class comparison is ignored'
|
61
|
+
end
|
62
|
+
|
63
|
+
context attributes_context_name do
|
64
|
+
comparison.entries.each do |entry|
|
65
|
+
printed_attribute_name = Attribute.printed_name(entry)
|
66
|
+
|
67
|
+
control_attribute_value = entry.control_value
|
68
|
+
compare_attribute_value = entry.compare_value
|
69
|
+
|
70
|
+
test printed_attribute_name do
|
71
|
+
detail "#{control_class.name.split('::').last} Value: #{control_attribute_value.inspect}"
|
72
|
+
detail "#{compare_class.name.split('::').last} Value: #{compare_attribute_value.inspect}"
|
73
|
+
|
74
|
+
assert(compare_attribute_value == control_attribute_value)
|
75
|
+
end
|
76
|
+
end
|
72
77
|
end
|
73
78
|
end
|
74
79
|
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: 0.0.0.2
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: evt-schema
|