evt-messaging-fixtures 1.1.0.0 → 1.1.2.3

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: 2596c8a59a865241f0c2894f59c7ffe282989a06a256dd73dd8e3bb2a0623c11
4
- data.tar.gz: 5446dbfa173520e8e6fb81c96813e0867f1fec641827ccd82a507326b9cb0e91
3
+ metadata.gz: 2a56c89ec94af46f6a188d41da68c9bab488386989b93c57c01632f81182e25e
4
+ data.tar.gz: d7b5fa5dfa95b190e31458ca865877b1a115455867eebbda25b4c88d71132e63
5
5
  SHA512:
6
- metadata.gz: bdd0fd896a082eb025aed135f8b801484d2b3809379ff4517796abf90fd2988781c68aba7c9b78aa81946a4bf5e209b67d3dffee45ed4223240270e379c66ec8
7
- data.tar.gz: 564b1810e0cb0bce8b390c07a701cb89b7d92b391adb48d0b9c805f407b855fccfb126d7e2fa52170b81b2b65ec9a12f7ba99eacbf035ed03e35bca1f97fc902
6
+ metadata.gz: ef63c97d530ecef05272847f01e34b401733362520516d97adfac3c30d028385f16bb742ca3364fa29f1dcccb60f5d1cca9c2f09d1682f5d741d565e660cb093
7
+ data.tar.gz: 6fc7e5c53073b39513abb03c5ce3f6fbbc053cb54ed425f46d27d943e0c00387b74b5a2f727d794c9e5662ff822bb35dbc8f53034f358e748a7d51f80e543a76
@@ -50,6 +50,14 @@ module Messaging
50
50
  end
51
51
  end
52
52
 
53
+ module Random
54
+ def self.example_class
55
+ Class.new do
56
+ include Messaging::Message
57
+ end
58
+ end
59
+ end
60
+
53
61
  module Metadata
54
62
  def self.example
55
63
  metadata = Messaging::Message::Metadata.new
@@ -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))
@@ -23,7 +23,15 @@ module Messaging
23
23
  end
24
24
 
25
25
  def title_context_name
26
- @title_context_name ||= "Message"
26
+ if @title_context_name.nil?
27
+ @title_context_name = "Message"
28
+
29
+ if not message.nil?
30
+ @title_context_name = "#{@title_context_name}: #{message_type}"
31
+ end
32
+ end
33
+
34
+ @title_context_name
27
35
  end
28
36
 
29
37
  initializer :message, :source_message, na(:title_context_name), :test_block
@@ -68,6 +76,7 @@ module Messaging
68
76
  attributes_context_name: "Attributes Assigned"
69
77
  )
70
78
  end
79
+ alias :assert_all_attributes_assigned :assert_attributes_assigned
71
80
 
72
81
  def assert_attributes_copied(attribute_names=nil)
73
82
  if source_message.nil?
@@ -6,7 +6,7 @@ module Messaging
6
6
  include TestBench::Fixture
7
7
  include Initializer
8
8
 
9
- initializer :message, :stream_name, :expected_version, :reply_stream_name, :test_block
9
+ initializer :message_class, :message, :stream_name, :expected_version, :reply_stream_name, :test_block
10
10
 
11
11
  def self.build(writer, message_class, &test_block)
12
12
  data = get_data(writer, message_class)
@@ -16,7 +16,7 @@ module Messaging
16
16
  expected_version = data&.expected_version
17
17
  reply_stream_name = data&.reply_stream_name
18
18
 
19
- new(message, stream_name, expected_version, reply_stream_name, test_block)
19
+ new(message_class, message, stream_name, expected_version, reply_stream_name, test_block)
20
20
  end
21
21
 
22
22
  def self.get_data(writer, message_class)
@@ -38,12 +38,7 @@ module Messaging
38
38
  end
39
39
 
40
40
  def call
41
- message_class = message&.class
42
-
43
- context_name = 'Write'
44
- if not message_class.nil?
45
- context_name = "#{context_name}: #{message_class&.message_type}"
46
- end
41
+ context_name = "Write: #{message_class.message_type}"
47
42
 
48
43
  context context_name do
49
44
  if test_block.nil?
@@ -55,14 +50,14 @@ module Messaging
55
50
  written = !message.nil?
56
51
 
57
52
  test "Written" do
58
- if not test_block.nil?
53
+ if not written
59
54
  detail "Remaining message tests are skipped"
60
55
  end
61
56
 
62
57
  assert(written)
63
58
  end
64
59
 
65
- return if !written
60
+ return if not written
66
61
 
67
62
  test_block.call(self)
68
63
  end
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.0.0
4
+ version: 1.1.2.3
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-15 00:00:00.000000000 Z
11
+ date: 2020-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: evt-entity_store
@@ -79,7 +79,7 @@ homepage: https://github.com/eventide-project/messaging-fixtures
79
79
  licenses:
80
80
  - MIT
81
81
  metadata: {}
82
- post_install_message:
82
+ post_install_message:
83
83
  rdoc_options: []
84
84
  require_paths:
85
85
  - lib
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  requirements: []
97
97
  rubygems_version: 3.1.2
98
- signing_key:
98
+ signing_key:
99
99
  specification_version: 4
100
100
  summary: TestBench fixtures for the Messaging library
101
101
  test_files: []