evt-messaging-fixtures 1.1.2.3 → 1.1.3.0

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: 2a56c89ec94af46f6a188d41da68c9bab488386989b93c57c01632f81182e25e
4
- data.tar.gz: d7b5fa5dfa95b190e31458ca865877b1a115455867eebbda25b4c88d71132e63
3
+ metadata.gz: e4ef2a774aef994df0f13ae0ad49b8ac276c53e965ce5015d828ba421f0d4bfb
4
+ data.tar.gz: c8f79f24affdfb64e1f1048756382ef120aac5529f5c71b98d91340d4659bb40
5
5
  SHA512:
6
- metadata.gz: ef63c97d530ecef05272847f01e34b401733362520516d97adfac3c30d028385f16bb742ca3364fa29f1dcccb60f5d1cca9c2f09d1682f5d741d565e660cb093
7
- data.tar.gz: 6fc7e5c53073b39513abb03c5ce3f6fbbc053cb54ed425f46d27d943e0c00387b74b5a2f727d794c9e5662ff822bb35dbc8f53034f358e748a7d51f80e543a76
6
+ metadata.gz: 52d42ffaeebf8c89de5f1965eb75302246a04d05b2c1de3003a1516bad6fc5592db238d540019d5d23b73e4b021c8b591330b4cbb3bdc3514e746487e44e7085
7
+ data.tar.gz: e5a0949e5582d8e6124bad31f9bd666b8a2279ecc0f5438601d639dd14e8da453d3772c306ad8b35663260563053267348314e4ade64a1b6a0e3c3545c3f6bfd
@@ -22,6 +22,13 @@ module Messaging
22
22
  source_message_class.name.split('::').last
23
23
  end
24
24
 
25
+ def print_title_context?
26
+ if @print_title_context.nil?
27
+ @print_title_context = true
28
+ end
29
+ @print_title_context
30
+ end
31
+
25
32
  def title_context_name
26
33
  if @title_context_name.nil?
27
34
  @title_context_name = "Message"
@@ -34,37 +41,43 @@ module Messaging
34
41
  @title_context_name
35
42
  end
36
43
 
37
- initializer :message, :source_message, na(:title_context_name), :test_block
44
+ initializer :message, :source_message, na(:print_title_context), na(:title_context_name), :test_block
38
45
 
39
- def self.build(message, source_message=nil, title_context_name: nil, &test_block)
40
- new(message, source_message, title_context_name, test_block)
46
+ def self.build(message, source_message=nil, print_title_context: nil, title_context_name: nil, &test_block)
47
+ new(message, source_message, print_title_context, title_context_name, test_block)
41
48
  end
42
49
 
43
50
  def call
44
- context_name = title_context_name
45
-
46
- context context_name do
47
- if test_block.nil?
48
- raise Error, "Message fixture must be executed with a block"
49
- end
50
-
51
- if message.nil?
52
- test "Not nil" do
53
- detail "Message: nil"
54
- detail "Remaining message tests are skipped"
55
- refute(message.nil?)
56
- end
57
- return
51
+ if print_title_context?
52
+ context "#{title_context_name}" do
53
+ call!
58
54
  end
55
+ else
56
+ call!
57
+ end
58
+ end
59
59
 
60
- detail "Message Class: #{message_class.name}"
60
+ def call!
61
+ if test_block.nil?
62
+ raise Error, "Message fixture must be executed with a block"
63
+ end
61
64
 
62
- if not source_message.nil?
63
- detail "Source Message Class: #{source_message_class.name}"
65
+ if message.nil?
66
+ test "Not nil" do
67
+ detail "Message: nil"
68
+ detail "Remaining message tests are skipped"
69
+ refute(message.nil?)
64
70
  end
71
+ return
72
+ end
73
+
74
+ detail "Message Class: #{message_class.name}"
65
75
 
66
- test_block.call(self)
76
+ if not source_message.nil?
77
+ detail "Source Message Class: #{source_message_class.name}"
67
78
  end
79
+
80
+ test_block.call(self)
68
81
  end
69
82
 
70
83
  def assert_attributes_assigned(attribute_names=nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evt-messaging-fixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2.3
4
+ version: 1.1.3.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-30 00:00:00.000000000 Z
11
+ date: 2020-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-entity_store