evt-messaging-fixtures 1.1.2.0 → 1.1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/messaging/fixtures/follows.rb +5 -5
- data/lib/messaging/fixtures/message.rb +51 -21
- 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: bc5e3091ad4d8be8bde9f80803d3869e18b4e4c109462f971ec659a191ef4a6a
|
4
|
+
data.tar.gz: 93f87536e10acb084b6ad3aa8ba16f6f3df25ec85911a8cfd9000dce34cb686a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b380ec23b9c0a066bcac638c39fa17dc1e6f87dfacfb992e5bc5054ae1c09b9dc2e04d2eb7b8d36b3b531acad7cbaebad62fda69703884ab728d6358dd1c0222
|
7
|
+
data.tar.gz: 4b87775c9aaaa334fa061b8803b18503987fe5c24a3e3dcaceebb5c9f669abce4b26ac66499e049d1f2d68ab527b21b5b8b19d13cc05322520e9307999762f1a
|
@@ -34,19 +34,19 @@ module Messaging
|
|
34
34
|
|
35
35
|
def call!
|
36
36
|
test "Follows" do
|
37
|
-
detail "Stream Name: #{source_metadata.stream_name.inspect}"
|
37
|
+
detail "Source Message Stream Name: #{source_metadata.stream_name.inspect}"
|
38
38
|
detail "Causation Stream Name: #{metadata.causation_message_stream_name.inspect}"
|
39
39
|
|
40
|
-
detail "Position: #{source_metadata.position.inspect}"
|
40
|
+
detail "Source Message Position: #{source_metadata.position.inspect}"
|
41
41
|
detail "Causation Position: #{metadata.causation_message_position.inspect}"
|
42
42
|
|
43
|
-
detail "Global Position: #{source_metadata.global_position.inspect}"
|
43
|
+
detail "Source Message Global Position: #{source_metadata.global_position.inspect}"
|
44
44
|
detail "Causation Global Position: #{metadata.causation_message_global_position.inspect}"
|
45
45
|
|
46
|
-
detail "Source Correlation Stream Name: #{source_metadata.correlation_stream_name.inspect}"
|
46
|
+
detail "Source Message Correlation Stream Name: #{source_metadata.correlation_stream_name.inspect}"
|
47
47
|
detail "Correlation Stream Name: #{metadata.correlation_stream_name.inspect}"
|
48
48
|
|
49
|
-
detail "Source Reply Stream Name: #{source_metadata.reply_stream_name.inspect}"
|
49
|
+
detail "Source Message Reply Stream Name: #{source_metadata.reply_stream_name.inspect}"
|
50
50
|
detail "Reply Stream Name: #{metadata.reply_stream_name.inspect}"
|
51
51
|
|
52
52
|
assert(metadata.follows?(source_metadata))
|
@@ -22,41 +22,71 @@ 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
|
-
@title_context_name
|
33
|
+
if @title_context_name.nil?
|
34
|
+
@title_context_name = "Message"
|
35
|
+
|
36
|
+
if not message.nil?
|
37
|
+
@title_context_name = "#{@title_context_name}: #{message_type}"
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
@title_context_name
|
27
42
|
end
|
28
43
|
|
29
|
-
|
44
|
+
def detail_message_class?
|
45
|
+
if @detail_message_class.nil?
|
46
|
+
@detail_message_class = true
|
47
|
+
end
|
48
|
+
@detail_message_class
|
49
|
+
end
|
30
50
|
|
31
|
-
|
32
|
-
|
51
|
+
initializer :message, :source_message, na(:print_title_context), na(:title_context_name), na(:detail_message_class), :test_block
|
52
|
+
|
53
|
+
def self.build(message, source_message=nil, print_title_context: nil, title_context_name: nil, detail_message_class: nil, &test_block)
|
54
|
+
new(message, source_message, print_title_context, title_context_name, detail_message_class, test_block)
|
33
55
|
end
|
34
56
|
|
35
57
|
def call
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
if test_block.nil?
|
40
|
-
raise Error, "Message fixture must be executed with a block"
|
58
|
+
if print_title_context?
|
59
|
+
context "#{title_context_name}" do
|
60
|
+
call!
|
41
61
|
end
|
62
|
+
else
|
63
|
+
call!
|
64
|
+
end
|
65
|
+
end
|
42
66
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
67
|
+
def call!
|
68
|
+
if test_block.nil?
|
69
|
+
raise Error, "Message fixture must be executed with a block"
|
70
|
+
end
|
71
|
+
|
72
|
+
if message.nil?
|
73
|
+
test "Not nil" do
|
74
|
+
detail "Message: nil"
|
75
|
+
detail "Remaining message tests are skipped"
|
76
|
+
refute(message.nil?)
|
50
77
|
end
|
78
|
+
return
|
79
|
+
end
|
51
80
|
|
81
|
+
if detail_message_class?
|
52
82
|
detail "Message Class: #{message_class.name}"
|
83
|
+
end
|
53
84
|
|
54
|
-
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
test_block.call(self)
|
85
|
+
if not source_message.nil?
|
86
|
+
detail "Source Message Class: #{source_message_class.name}"
|
59
87
|
end
|
88
|
+
|
89
|
+
test_block.call(self)
|
60
90
|
end
|
61
91
|
|
62
92
|
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.
|
4
|
+
version: 1.1.4.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-
|
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
|