evt-schema-fixtures 0.0.0.2 → 1.0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4aba8e6d289ada91eb6a816228e671406c452d44aadc81ca93436f524e4ce4eb
4
- data.tar.gz: 42b67a76d1e6e6313b24ed1c94e81abc58422df18c3578963582333c60663f31
3
+ metadata.gz: a4c11678b6ddf055b5fbf960e75f2e9851db4129b04bb956c740bbec4d67b81b
4
+ data.tar.gz: c59b1076bce52b503749860cd8190ff60306ab50ab4ef9e950830457b0882fbe
5
5
  SHA512:
6
- metadata.gz: 6fce286c690fc11f9b9fbcb0fec7e0b0f7a8db95bc050eee499d8c9cbf5a9c663a4010490b0e24f64718346f760c4bf798892789c3f31519ef5c75e98a0acb70
7
- data.tar.gz: eeefc8f33ff316b579db3ee86353b19d5c9a14bfed9bd184ccf1954dab3c29077063733bbf3f7603b51e17363e3189f4bf71f597e8b4649b4223c5d966f520ae
6
+ metadata.gz: f58a407bf4d993dd9e7480ba1ed3541d2ba973b015f403a0012a943d9a43a18c780603a02307c691c8a74e127fc6af242034a3944d38b59e1ac87e23a921ce84
7
+ data.tar.gz: 6452d38da4bd44f82826a9f6b5b713e6ccfecbe1dcc46211cd720600c4c84c1dceb7a748b57085fa68612b9c71869ddf9074eeea09705683a8f383b669c94a8d
@@ -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
- test_attributes.()
39
+ call!
54
40
  end
55
41
  else
56
- test_attributes.()
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.pretty_inspect}"
54
+ detail "Assigned Value: #{attribute_value.pretty_inspect}"
55
+
56
+ refute(attribute_value == default_attribute_value)
57
+ end
58
+ end
57
59
  end
58
60
  end
59
61
  end
@@ -56,8 +56,6 @@ module Schema
56
56
  test "Classes are the same" do
57
57
  assert(control_class == compare_class)
58
58
  end
59
- else
60
- detail 'Class comparison is ignored'
61
59
  end
62
60
 
63
61
  context attributes_context_name do
@@ -68,8 +66,8 @@ module Schema
68
66
  compare_attribute_value = entry.compare_value
69
67
 
70
68
  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}"
69
+ detail "#{control_class.name.split('::').last} Value: #{control_attribute_value.pretty_inspect}"
70
+ detail "#{compare_class.name.split('::').last} Value: #{compare_attribute_value.pretty_inspect}"
73
71
 
74
72
  assert(compare_attribute_value == control_attribute_value)
75
73
  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.2
4
+ version: 1.0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Eventide Project
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-03 00:00:00.000000000 Z
11
+ date: 2021-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-schema
@@ -67,7 +67,7 @@ homepage: https://github.com/eventide-project/schema-fixtures
67
67
  licenses:
68
68
  - MIT
69
69
  metadata: {}
70
- post_install_message:
70
+ post_install_message:
71
71
  rdoc_options: []
72
72
  require_paths:
73
73
  - lib
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubygems_version: 3.1.2
86
- signing_key:
86
+ signing_key:
87
87
  specification_version: 4
88
88
  summary: TestBench fixtures for the Schema library
89
89
  test_files: []