Class: Messaging::Fixtures::Metadata
- Inherits:
-
Object
- Object
- Messaging::Fixtures::Metadata
- Includes:
- Initializer, TestBench::Fixture
- Defined in:
- lib/messaging/fixtures/metadata.rb
Constant Summary collapse
- Error =
Class.new(RuntimeError)
Class Method Summary collapse
Instance Method Summary collapse
- #assert_attributes_assigned(attribute_names = nil, context_title_qualifier: nil) ⇒ Object
- #assert_causation_attributes_assigned ⇒ Object
- #assert_correlation_stream_name(correlation_stream_name) ⇒ Object
- #assert_follows ⇒ Object
- #assert_reply_stream_name(reply_stream_name) ⇒ Object
- #assert_source_attributes_assigned ⇒ Object
- #assert_workflow_attributes_assigned ⇒ Object
- #call ⇒ Object
Class Method Details
.build(metadata, source_metadata = nil, &test_block) ⇒ Object
11 12 13 |
# File 'lib/messaging/fixtures/metadata.rb', line 11 def self.build(, =nil, &test_block) new(, , test_block) end |
Instance Method Details
#assert_attributes_assigned(attribute_names = nil, context_title_qualifier: nil) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/messaging/fixtures/metadata.rb', line 38 def assert_attributes_assigned(attribute_names=nil, context_title_qualifier: nil) attribute_names ||= Messaging::Message::Metadata.all_attribute_names attributes_context_title = "#{context_title_qualifier} Attributes Assigned".lstrip fixture( Schema::Fixtures::Assignment, , attribute_names, print_title_context: false, attributes_context_name: attributes_context_title ) end |
#assert_causation_attributes_assigned ⇒ Object
62 63 64 65 |
# File 'lib/messaging/fixtures/metadata.rb', line 62 def assert_causation_attributes_assigned attribute_names = Messaging::Message::Metadata.causation_attribute_names assert_attributes_assigned(attribute_names, context_title_qualifier: 'Causation') end |
#assert_correlation_stream_name(correlation_stream_name) ⇒ Object
67 68 69 70 71 72 73 74 75 |
# File 'lib/messaging/fixtures/metadata.rb', line 67 def assert_correlation_stream_name(correlation_stream_name) = .correlation_stream_name test "correlation_stream_name" do detail "Metadata Value: #{metadata_value}" detail "Compare Value: #{correlation_stream_name}" assert( == correlation_stream_name) end end |
#assert_follows ⇒ Object
87 88 89 |
# File 'lib/messaging/fixtures/metadata.rb', line 87 def assert_follows fixture(Follows, , ) end |
#assert_reply_stream_name(reply_stream_name) ⇒ Object
77 78 79 80 81 82 83 84 85 |
# File 'lib/messaging/fixtures/metadata.rb', line 77 def assert_reply_stream_name(reply_stream_name) = .reply_stream_name test "reply_stream_name" do detail "Metadata Value: #{metadata_value}" detail "Compare Value: #{reply_stream_name}" assert( == reply_stream_name) end end |
#assert_source_attributes_assigned ⇒ Object
52 53 54 55 |
# File 'lib/messaging/fixtures/metadata.rb', line 52 def assert_source_attributes_assigned attribute_names = Messaging::Message::Metadata.source_attribute_names assert_attributes_assigned(attribute_names, context_title_qualifier: 'Source') end |
#assert_workflow_attributes_assigned ⇒ Object
57 58 59 60 |
# File 'lib/messaging/fixtures/metadata.rb', line 57 def assert_workflow_attributes_assigned attribute_names = Messaging::Message::Metadata.workflow_attribute_names assert_attributes_assigned(attribute_names, context_title_qualifier: 'Workflow') end |
#call ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/messaging/fixtures/metadata.rb', line 15 def call context "Metadata" do if test_block.nil? raise Error, "Metadata fixture must be executed with a block" end if .nil? test "Not nil" do detail "Metadata: nil" if not test_block.nil? detail "Remaining message tests are skipped" end refute(.nil?) end return end test_block.call(self) end end |