diff --git a/Gemfile b/Gemfile index fa75df1..b4e2a20 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,3 @@ -source 'https://rubygems.org' +source "https://rubygems.org" gemspec diff --git a/init.rb b/init.rb index 4813b6d..0251fe2 100644 --- a/init.rb +++ b/init.rb @@ -1,3 +1,3 @@ -require_relative 'load_path' +require_relative "load_path" -require 'message_store' +require "message_store" diff --git a/lib/message_store.rb b/lib/message_store.rb index 32077c1..7b55266 100644 --- a/lib/message_store.rb +++ b/lib/message_store.rb @@ -1,30 +1,30 @@ -require 'pp' -require 'json' +require "pp" +require "json" -require 'casing' -require 'identifier/uuid' -require 'schema' -require 'initializer' -require 'transform' -require 'template_method' -require 'async_invocation' +require "casing" +require "identifier/uuid" +require "schema" +require "initializer" +require "transform" +require "template_method" +require "async_invocation" -require 'message_store/expected_version' -require 'message_store/no_stream' -require 'message_store/id' -require 'message_store/stream_name' +require "message_store/expected_version" +require "message_store/no_stream" +require "message_store/id" +require "message_store/stream_name" -require 'message_store/message_data' -require 'message_store/message_data/hash/transform' -require 'message_store/message_data/write' -require 'message_store/message_data/read' +require "message_store/message_data" +require "message_store/message_data/hash/transform" +require "message_store/message_data/write" +require "message_store/message_data/read" -require 'message_store/log' +require "message_store/log" -require 'message_store/get' -require 'message_store/get/substitute' -require 'message_store/get/stream/last' -require 'message_store/get/stream/last/substitute' -require 'message_store/read/iterator' -require 'message_store/read' -require 'message_store/write' +require "message_store/get" +require "message_store/get/substitute" +require "message_store/get/stream/last" +require "message_store/get/stream/last/substitute" +require "message_store/read/iterator" +require "message_store/read" +require "message_store/write" diff --git a/lib/message_store/controls.rb b/lib/message_store/controls.rb index 8d8d60a..98da49a 100644 --- a/lib/message_store/controls.rb +++ b/lib/message_store/controls.rb @@ -1,19 +1,19 @@ -require 'securerandom' +require "securerandom" -require 'clock/controls' -require 'identifier/uuid/controls' +require "clock/controls" +require "identifier/uuid/controls" -require 'message_store/controls/random_value' -require 'message_store/controls/time' -require 'message_store/controls/id' -require 'message_store/controls/category' -require 'message_store/controls/stream_name' -require 'message_store/controls/read' -require 'message_store/controls/message_data' -require 'message_store/controls/message_data/hash' -require 'message_store/controls/message_data/metadata' -require 'message_store/controls/message_data/write' -require 'message_store/controls/message_data/read' -require 'message_store/controls/write' -require 'message_store/controls/get' -require 'message_store/controls/get_last' +require "message_store/controls/random_value" +require "message_store/controls/time" +require "message_store/controls/id" +require "message_store/controls/category" +require "message_store/controls/stream_name" +require "message_store/controls/read" +require "message_store/controls/message_data" +require "message_store/controls/message_data/hash" +require "message_store/controls/message_data/metadata" +require "message_store/controls/message_data/write" +require "message_store/controls/message_data/read" +require "message_store/controls/write" +require "message_store/controls/get" +require "message_store/controls/get_last" diff --git a/lib/message_store/controls/category.rb b/lib/message_store/controls/category.rb index d673878..e34ee89 100644 --- a/lib/message_store/controls/category.rb +++ b/lib/message_store/controls/category.rb @@ -10,7 +10,7 @@ def self.example(category: nil, type: nil, types: nil, randomize_category: nil) randomize_category = true if randomize_category.nil? - category ||= 'test' + category ||= "test" if randomize_category category = "#{category}#{SecureRandom.hex(16)}XX" diff --git a/lib/message_store/controls/message_data.rb b/lib/message_store/controls/message_data.rb index 3d81fa4..6b9987d 100644 --- a/lib/message_store/controls/message_data.rb +++ b/lib/message_store/controls/message_data.rb @@ -6,11 +6,11 @@ def self.id end def self.type - 'SomeType' + "SomeType" end def self.other_type - 'SomeOtherType' + "SomeOtherType" end def self.data diff --git a/lib/message_store/controls/message_data/hash.rb b/lib/message_store/controls/message_data/hash.rb index cde6794..87955c1 100644 --- a/lib/message_store/controls/message_data/hash.rb +++ b/lib/message_store/controls/message_data/hash.rb @@ -4,7 +4,7 @@ module MessageData module Hash def self.data { - some_attribute: 'some value' + some_attribute: "some value" } end diff --git a/lib/message_store/controls/stream_name.rb b/lib/message_store/controls/stream_name.rb index e2ba910..b17e98a 100644 --- a/lib/message_store/controls/stream_name.rb +++ b/lib/message_store/controls/stream_name.rb @@ -18,7 +18,7 @@ def self.stream_name(category, id=nil, type: nil, types: nil) types.unshift(type) unless type.nil? type_list = nil - type_list = types.join('+') unless types.empty? + type_list = types.join("+") unless types.empty? stream_name = category stream_name = "#{stream_name}:#{type_list}" unless type_list.nil? diff --git a/lib/message_store/id.rb b/lib/message_store/id.rb index 8ba0e9e..1f6a7df 100644 --- a/lib/message_store/id.rb +++ b/lib/message_store/id.rb @@ -3,7 +3,7 @@ module ID Error = Class.new(RuntimeError) def self.compound_id_separator - '+' + "+" end def self.id(id) diff --git a/lib/message_store/stream_name.rb b/lib/message_store/stream_name.rb index a736d60..498eff5 100644 --- a/lib/message_store/stream_name.rb +++ b/lib/message_store/stream_name.rb @@ -3,7 +3,7 @@ module StreamName Error = Class.new(RuntimeError) def self.id_separator - '-' + "-" end def self.compound_id_separator @@ -11,11 +11,11 @@ def self.compound_id_separator end def self.category_type_separator - ':' + ":" end def self.compound_type_separator - '+' + "+" end def self.stream_name(category, stream_id=nil, cardinal_id: nil, id: nil, ids: nil, type: nil, types: nil) diff --git a/lib/message_store/write.rb b/lib/message_store/write.rb index 2c03bc0..d009089 100644 --- a/lib/message_store/write.rb +++ b/lib/message_store/write.rb @@ -45,7 +45,7 @@ def call(message_data, stream_name, expected_version: nil) batch = Array(message_data) logger.trace(tag: :write) do - message_types = batch.map {|message_data| message_data.type }.uniq.join(', ') + message_types = batch.map {|message_data| message_data.type }.uniq.join(", ") "Writing message data (Types: #{message_types}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect}, Number of Messages: #{batch.length})" end logger.trace(tags: [:data, :message_data]) { batch.pretty_inspect } @@ -55,7 +55,7 @@ def call(message_data, stream_name, expected_version: nil) position = write(batch, stream_name, expected_version: expected_version) logger.info(tag: :write) do - message_types = batch.map {|message_data| message_data.type }.uniq.join(', ') + message_types = batch.map {|message_data| message_data.type }.uniq.join(", ") "Wrote message data (Types: #{message_types}, Stream Name: #{stream_name}, Expected Version: #{expected_version.inspect}, Number of Messages: #{batch.length})" end logger.info(tags: [:data, :message_data]) { batch.pretty_inspect } diff --git a/load_path.rb b/load_path.rb index 4f7ebf2..69ebac3 100644 --- a/load_path.rb +++ b/load_path.rb @@ -1,4 +1,4 @@ -bundler_standalone_loader = 'gems/bundler/setup' +bundler_standalone_loader = "gems/bundler/setup" begin require_relative bundler_standalone_loader @@ -8,10 +8,10 @@ Bundler.require end -lib_dir = File.expand_path('lib', __dir__) +lib_dir = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir) -libraries_dir = ENV['LIBRARIES_HOME'] +libraries_dir = ENV["LIBRARIES_HOME"] unless libraries_dir.nil? libraries_dir = File.expand_path(libraries_dir) $LOAD_PATH.unshift libraries_dir unless $LOAD_PATH.include?(libraries_dir) diff --git a/message_store.gemspec b/message_store.gemspec index 3e0f4f7..7db58c5 100644 --- a/message_store.gemspec +++ b/message_store.gemspec @@ -1,27 +1,27 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| - s.name = 'evt-message_store' - s.version = '2.4.0.1' - s.summary = 'Common primitives for platform-specific message store implementations' - s.description = ' ' + s.name = "evt-message_store" + s.version = "2.4.0.1" + s.summary = "Common primitives for platform-specific message store implementations" + s.description = " " - s.authors = ['The Eventide Project'] - s.email = 'opensource@eventide-project.org' - s.homepage = 'https://github.com/eventide-project/message-store' - s.licenses = ['MIT'] + s.authors = ["The Eventide Project"] + s.email = "opensource@eventide-project.org" + s.homepage = "https://github.com/eventide-project/message-store" + s.licenses = ["MIT"] - s.require_paths = ['lib'] - s.files = Dir.glob('{lib}/**/*') + s.require_paths = ["lib"] + s.files = Dir.glob("{lib}/**/*") s.platform = Gem::Platform::RUBY - s.required_ruby_version = '>= 2.4.0' + s.required_ruby_version = ">= 2.4.0" - s.add_runtime_dependency 'evt-casing' - s.add_runtime_dependency 'evt-schema' - s.add_runtime_dependency 'evt-initializer' - s.add_runtime_dependency 'evt-identifier-uuid' - s.add_runtime_dependency 'evt-transform' - s.add_runtime_dependency 'evt-template_method' - s.add_runtime_dependency 'evt-async_invocation' + s.add_runtime_dependency "evt-casing" + s.add_runtime_dependency "evt-schema" + s.add_runtime_dependency "evt-initializer" + s.add_runtime_dependency "evt-identifier-uuid" + s.add_runtime_dependency "evt-transform" + s.add_runtime_dependency "evt-template_method" + s.add_runtime_dependency "evt-async_invocation" - s.add_development_dependency 'test_bench' + s.add_development_dependency "test_bench" end diff --git a/test.rb b/test.rb index d92b472..7172472 100644 --- a/test.rb +++ b/test.rb @@ -1 +1 @@ -require_relative 'test/automated' +require_relative "test/automated" diff --git a/test/automated.rb b/test/automated.rb index 9a08835..94c1b1e 100644 --- a/test/automated.rb +++ b/test/automated.rb @@ -1,6 +1,6 @@ -require_relative './test_init' +require_relative "./test_init" TestBench::Run.( - 'test/automated', - exclude: '{_*,*sketch*,*_init,*_tests}.rb' + "test/automated", + exclude: "{_*,*sketch*,*_init,*_tests}.rb" ) or exit(false) diff --git a/test/automated/automated_init.rb b/test/automated/automated_init.rb index faa8577..f9272a5 100644 --- a/test/automated/automated_init.rb +++ b/test/automated/automated_init.rb @@ -1 +1 @@ -require_relative '../test_init' +require_relative "../test_init" diff --git a/test/automated/get_last/call.rb b/test/automated/get_last/call.rb index 11adf91..39d6275 100644 --- a/test/automated/get_last/call.rb +++ b/test/automated/get_last/call.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Get Last" do context "Call" do diff --git a/test/automated/get_last/configure.rb b/test/automated/get_last/configure.rb index b943da5..a843ab7 100644 --- a/test/automated/get_last/configure.rb +++ b/test/automated/get_last/configure.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Get Last" do context "Configure" do diff --git a/test/automated/get_last/substitute.rb b/test/automated/get_last/substitute.rb index 508a5f7..2325a5d 100644 --- a/test/automated/get_last/substitute.rb +++ b/test/automated/get_last/substitute.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Get Last" do context "Substitute" do diff --git a/test/automated/id/compose.rb b/test/automated/id/compose.rb index d9c0075..919d5e9 100644 --- a/test/automated/id/compose.rb +++ b/test/automated/id/compose.rb @@ -1,10 +1,10 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "ID" do context "Compose" do context "Singular ID" do context "Not Nil" do - id = 'some_id' + id = "some_id" compound_id = MessageStore::ID.id(id) @@ -26,12 +26,12 @@ context "List of IDs" do context "Not Empty" do - id = ['some_id', 'some_other_id'] + id = ["some_id", "some_other_id"] compound_id = MessageStore::ID.id(id) - test "Composed ID is the concatenation of the list of IDs delimited by the '+'' sign" do - assert(compound_id == 'some_id+some_other_id') + test "Composed ID is the concatenation of the list of IDs delimited by the \"+\" sign" do + assert(compound_id == "some_id+some_other_id") end end diff --git a/test/automated/id/get_cardinal_id.rb b/test/automated/id/get_cardinal_id.rb index 2bc1dcb..0a9d625 100644 --- a/test/automated/id/get_cardinal_id.rb +++ b/test/automated/id/get_cardinal_id.rb @@ -1,23 +1,23 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Get Cardinal ID" do context "Singular ID" do - id = 'some_id' + id = "some_id" cardinal_id = ID.get_cardinal_id(id) test "Cardinal ID is the ID" do - assert(cardinal_id == 'some_id') + assert(cardinal_id == "some_id") end end context "Compound ID" do - id = 'some_id+some_other_id' + id = "some_id+some_other_id" cardinal_id = ID.get_cardinal_id(id) test "ID is the first ID" do - assert(cardinal_id == 'some_id') + assert(cardinal_id == "some_id") end end diff --git a/test/automated/id/parse.rb b/test/automated/id/parse.rb index 0317e87..e600c39 100644 --- a/test/automated/id/parse.rb +++ b/test/automated/id/parse.rb @@ -1,23 +1,23 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Parse" do context "Singular ID" do - id = 'some_id' + id = "some_id" parsed_id = ID.parse(id) test "Parsed IDis a list containing the ID" do - assert(parsed_id == ['some_id']) + assert(parsed_id == ["some_id"]) end end context "Compound ID" do - id = 'some_id+some_other_id' + id = "some_id+some_other_id" parsed_id = ID.parse(id) test "Parsed IDis a list containing the individual IDs" do - assert(parsed_id == ['some_id', 'some_other_id']) + assert(parsed_id == ["some_id", "some_other_id"]) end end diff --git a/test/automated/iterator/batch_depletion/depleted/batch_index_is_batch_length.rb b/test/automated/iterator/batch_depletion/depleted/batch_index_is_batch_length.rb index 0bf8f60..dd115b3 100644 --- a/test/automated/iterator/batch_depletion/depleted/batch_index_is_batch_length.rb +++ b/test/automated/iterator/batch_depletion/depleted/batch_index_is_batch_length.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Batch Depletion" do diff --git a/test/automated/iterator/batch_depletion/depleted/batch_is_empty.rb b/test/automated/iterator/batch_depletion/depleted/batch_is_empty.rb index 58bbccb..9bcb24b 100644 --- a/test/automated/iterator/batch_depletion/depleted/batch_is_empty.rb +++ b/test/automated/iterator/batch_depletion/depleted/batch_is_empty.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Batch Depletion" do diff --git a/test/automated/iterator/batch_depletion/depleted/batch_is_nil.rb b/test/automated/iterator/batch_depletion/depleted/batch_is_nil.rb index 36370ca..ff9b1fb 100644 --- a/test/automated/iterator/batch_depletion/depleted/batch_is_nil.rb +++ b/test/automated/iterator/batch_depletion/depleted/batch_is_nil.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Batch Depletion" do diff --git a/test/automated/iterator/batch_depletion/not_depleted/batch_index_less_than_batch_length.rb b/test/automated/iterator/batch_depletion/not_depleted/batch_index_less_than_batch_length.rb index 6fdd665..5822dc4 100644 --- a/test/automated/iterator/batch_depletion/not_depleted/batch_index_less_than_batch_length.rb +++ b/test/automated/iterator/batch_depletion/not_depleted/batch_index_less_than_batch_length.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Batch Depletion" do diff --git a/test/automated/iterator/batch_initialization.rb b/test/automated/iterator/batch_initialization.rb index bc0740e..ad94ff4 100644 --- a/test/automated/iterator/batch_initialization.rb +++ b/test/automated/iterator/batch_initialization.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Iterator" do context "Batch Initialization" do diff --git a/test/automated/iterator/next/category/next.rb b/test/automated/iterator/next/category/next.rb index c930710..1a97f17 100644 --- a/test/automated/iterator/next/category/next.rb +++ b/test/automated/iterator/next/category/next.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Next" do diff --git a/test/automated/iterator/next/category/next_from_position.rb b/test/automated/iterator/next/category/next_from_position.rb index 6202b53..ba32131 100644 --- a/test/automated/iterator/next/category/next_from_position.rb +++ b/test/automated/iterator/next/category/next_from_position.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Next" do diff --git a/test/automated/iterator/next/stream/next.rb b/test/automated/iterator/next/stream/next.rb index c930710..1a97f17 100644 --- a/test/automated/iterator/next/stream/next.rb +++ b/test/automated/iterator/next/stream/next.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Next" do diff --git a/test/automated/iterator/next/stream/next_from_position.rb b/test/automated/iterator/next/stream/next_from_position.rb index 3fdeb56..17b0c10 100644 --- a/test/automated/iterator/next/stream/next_from_position.rb +++ b/test/automated/iterator/next/stream/next_from_position.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Next" do diff --git a/test/automated/iterator/no_further_message_data.rb b/test/automated/iterator/no_further_message_data.rb index 875a6f3..f3b4832 100644 --- a/test/automated/iterator/no_further_message_data.rb +++ b/test/automated/iterator/no_further_message_data.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Iterator" do context "Next" do diff --git a/test/automated/iterator/stream_depletion/depleted/resulting_batch_size_less_than_requested_batch_size.rb b/test/automated/iterator/stream_depletion/depleted/resulting_batch_size_less_than_requested_batch_size.rb index a4846a4..53926a8 100644 --- a/test/automated/iterator/stream_depletion/depleted/resulting_batch_size_less_than_requested_batch_size.rb +++ b/test/automated/iterator/stream_depletion/depleted/resulting_batch_size_less_than_requested_batch_size.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Stream Depletion" do diff --git a/test/automated/iterator/stream_depletion/not_depleted/batch_is_uninitialized.rb b/test/automated/iterator/stream_depletion/not_depleted/batch_is_uninitialized.rb index 7177ea5..0e305ab 100644 --- a/test/automated/iterator/stream_depletion/not_depleted/batch_is_uninitialized.rb +++ b/test/automated/iterator/stream_depletion/not_depleted/batch_is_uninitialized.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Stream Depletion" do diff --git a/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_equal_to_requested_batch_size.rb b/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_equal_to_requested_batch_size.rb index bab870b..edb1bf3 100644 --- a/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_equal_to_requested_batch_size.rb +++ b/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_equal_to_requested_batch_size.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Stream Depletion" do diff --git a/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_greater_than_requested_batch_size.rb b/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_greater_than_requested_batch_size.rb index c3200a8..968ea5c 100644 --- a/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_greater_than_requested_batch_size.rb +++ b/test/automated/iterator/stream_depletion/not_depleted/resulting_batch_size_greater_than_requested_batch_size.rb @@ -1,4 +1,4 @@ -require_relative '../../../automated_init' +require_relative "../../../automated_init" context "Iterator" do context "Stream Depletion" do diff --git a/test/automated/iterator_tests.rb b/test/automated/iterator_tests.rb index a65784a..3086da6 100644 --- a/test/automated/iterator_tests.rb +++ b/test/automated/iterator_tests.rb @@ -1,6 +1,6 @@ -require_relative './automated_init' +require_relative "./automated_init" TestBench::Run.( - 'test/automated/iterator', - exclude: '{_*,*sketch*,*_init,*_tests}.rb' + "test/automated/iterator", + exclude: "{_*,*sketch*,*_init,*_tests}.rb" ) or exit(false) diff --git a/test/automated/message_data/case_equality.rb b/test/automated/message_data/case_equality.rb index e1e781a..2947737 100644 --- a/test/automated/message_data/case_equality.rb +++ b/test/automated/message_data/case_equality.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "MessageData" do context "Case Equality" do diff --git a/test/automated/message_data/hash.rb b/test/automated/message_data/hash.rb index 08c0082..ff28908 100644 --- a/test/automated/message_data/hash.rb +++ b/test/automated/message_data/hash.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "MessageData" do context "Hash" do diff --git a/test/automated/read/asynchronous_result.rb b/test/automated/read/asynchronous_result.rb index 5520dd9..dfc424b 100644 --- a/test/automated/read/asynchronous_result.rb +++ b/test/automated/read/asynchronous_result.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Read" do context "Asynchronous Result" do diff --git a/test/automated/read/missing_block_error.rb b/test/automated/read/missing_block_error.rb index f4c5f85..d1d749b 100644 --- a/test/automated/read/missing_block_error.rb +++ b/test/automated/read/missing_block_error.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Read" do context "No block supplied" do diff --git a/test/automated/stream_name/category_predicate.rb b/test/automated/stream_name/category_predicate.rb index c33228c..b5bb5b1 100644 --- a/test/automated/stream_name/category_predicate.rb +++ b/test/automated/stream_name/category_predicate.rb @@ -1,9 +1,9 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Stream Name" do context "Category Predicate" do context "Stream Name Contains a Dash (-)" do - stream_name = 'someStream-some_id' + stream_name = "someStream-some_id" is_category = StreamName.category?(stream_name) @@ -13,7 +13,7 @@ end context "Stream Name Contains no Dash (-)" do - stream_name = 'someStream' + stream_name = "someStream" is_category = StreamName.category?(stream_name) diff --git a/test/automated/stream_name/compose/cardinal_id.rb b/test/automated/stream_name/compose/cardinal_id.rb index bb25c1f..e0c5f90 100644 --- a/test/automated/stream_name/compose/cardinal_id.rb +++ b/test/automated/stream_name/compose/cardinal_id.rb @@ -1,53 +1,53 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do context "Cardinal ID" do context "Cardinal ID" do - stream_name = StreamName.stream_name('someCategory', cardinal_id: 'some_cardinal_id') + stream_name = StreamName.stream_name("someCategory", cardinal_id: "some_cardinal_id") test "Stream name is the category and the cardinal ID" do - assert(stream_name == 'someCategory-some_cardinal_id') + assert(stream_name == "someCategory-some_cardinal_id") end end context "Cardinal ID and Positional ID" do - stream_name = StreamName.stream_name('someCategory', 'some_positional_id', cardinal_id: 'some_cardinal_id') + stream_name = StreamName.stream_name("someCategory", "some_positional_id", cardinal_id: "some_cardinal_id") test "Stream name is the category, the cardinal ID, and the positional ID" do - assert(stream_name == 'someCategory-some_cardinal_id+some_positional_id') + assert(stream_name == "someCategory-some_cardinal_id+some_positional_id") end end context "Cardinal ID and Named ID Argument" do - stream_name = StreamName.stream_name('someCategory', cardinal_id: 'some_cardinal_id', id: 'some_named_id') + stream_name = StreamName.stream_name("someCategory", cardinal_id: "some_cardinal_id", id: "some_named_id") test "Stream name is the category, the cardinal ID, and the named ID" do - assert(stream_name == 'someCategory-some_cardinal_id+some_named_id') + assert(stream_name == "someCategory-some_cardinal_id+some_named_id") end end context "Cardinal ID and Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', cardinal_id: 'some_cardinal_id', ids: 'some_named_ids') + stream_name = StreamName.stream_name("someCategory", cardinal_id: "some_cardinal_id", ids: "some_named_ids") test "Stream name is the category, the cardinal ID, and the named IDs" do - assert(stream_name == 'someCategory-some_cardinal_id+some_named_ids') + assert(stream_name == "someCategory-some_cardinal_id+some_named_ids") end end context "Cardinal ID, Named ID, and Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', cardinal_id: 'some_cardinal_id', id: 'some_named_id', ids: 'some_named_ids') + stream_name = StreamName.stream_name("someCategory", cardinal_id: "some_cardinal_id", id: "some_named_id", ids: "some_named_ids") test "Stream name is the category, the cardinal ID, the named ID, and the named IDs" do - assert(stream_name == 'someCategory-some_cardinal_id+some_named_id+some_named_ids') + assert(stream_name == "someCategory-some_cardinal_id+some_named_id+some_named_ids") end end context "Cardinal ID, Positional ID, Named ID, and Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', 'some_positional_id', cardinal_id: 'some_cardinal_id', id: 'some_named_id', ids: 'some_named_ids') + stream_name = StreamName.stream_name("someCategory", "some_positional_id", cardinal_id: "some_cardinal_id", id: "some_named_id", ids: "some_named_ids") test "Stream name is the category, the cardinal ID, the positional ID, the named ID, and the named IDs" do - assert(stream_name == 'someCategory-some_cardinal_id+some_positional_id+some_named_id+some_named_ids') + assert(stream_name == "someCategory-some_cardinal_id+some_positional_id+some_named_id+some_named_ids") end end end diff --git a/test/automated/stream_name/compose/category.rb b/test/automated/stream_name/compose/category.rb index 3472db5..5dd26e1 100644 --- a/test/automated/stream_name/compose/category.rb +++ b/test/automated/stream_name/compose/category.rb @@ -1,12 +1,12 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do context "Category" do - stream_name = StreamName.stream_name('someCategory') + stream_name = StreamName.stream_name("someCategory") test "Stream name is the category" do - assert(stream_name == 'someCategory') + assert(stream_name == "someCategory") end end end diff --git a/test/automated/stream_name/compose/compound_id.rb b/test/automated/stream_name/compose/compound_id.rb index 4e44bba..1397e9a 100644 --- a/test/automated/stream_name/compose/compound_id.rb +++ b/test/automated/stream_name/compose/compound_id.rb @@ -1,45 +1,45 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do context "Compound ID" do context "Positional ID Argument" do - stream_name = StreamName.stream_name('someCategory', ['some_positional_id', 'some_other_positional_id']) + stream_name = StreamName.stream_name("someCategory", ["some_positional_id", "some_other_positional_id"]) test "Stream name is the category and the ID" do - assert(stream_name == 'someCategory-some_positional_id+some_other_positional_id') + assert(stream_name == "someCategory-some_positional_id+some_other_positional_id") end end context "Named ID Argument" do - stream_name = StreamName.stream_name('someCategory', id: ['some_named_id', 'some_other_named_id']) + stream_name = StreamName.stream_name("someCategory", id: ["some_named_id", "some_other_named_id"]) test "Stream name is the category, and the named ID" do - assert(stream_name == 'someCategory-some_named_id+some_other_named_id') + assert(stream_name == "someCategory-some_named_id+some_other_named_id") end end context "Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', ids: ['some_named_id', 'some_other_named_id']) + stream_name = StreamName.stream_name("someCategory", ids: ["some_named_id", "some_other_named_id"]) test "Stream name is the category, and the named IDs" do - assert(stream_name == 'someCategory-some_named_id+some_other_named_id') + assert(stream_name == "someCategory-some_named_id+some_other_named_id") end end context "Named ID Argument, and Plural Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', id: ['some_named_id', 'some_other_named_id'], ids: ['yet_another_named_id', 'and_another_named_id']) + stream_name = StreamName.stream_name("someCategory", id: ["some_named_id", "some_other_named_id"], ids: ["yet_another_named_id", "and_another_named_id"]) test "Stream name is the category, the named ID, and the named IDs" do - assert(stream_name == 'someCategory-some_named_id+some_other_named_id+yet_another_named_id+and_another_named_id') + assert(stream_name == "someCategory-some_named_id+some_other_named_id+yet_another_named_id+and_another_named_id") end end context "Positional ID Argument, Named ID Argument, and Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', ['some_positional_id', 'some_other_positional_id'], id: ['some_named_id', 'some_other_named_id'], ids: ['yet_another_named_id', 'and_another_named_id']) + stream_name = StreamName.stream_name("someCategory", ["some_positional_id", "some_other_positional_id"], id: ["some_named_id", "some_other_named_id"], ids: ["yet_another_named_id", "and_another_named_id"]) test "Stream name is the category, the positional ID, and the named ID, and the named IDs" do - assert(stream_name == 'someCategory-some_positional_id+some_other_positional_id+some_named_id+some_other_named_id+yet_another_named_id+and_another_named_id') + assert(stream_name == "someCategory-some_positional_id+some_other_positional_id+some_named_id+some_other_named_id+yet_another_named_id+and_another_named_id") end end end diff --git a/test/automated/stream_name/compose/missing_category_error.rb b/test/automated/stream_name/compose/missing_category_error.rb index d78bd27..255c9f3 100644 --- a/test/automated/stream_name/compose/missing_category_error.rb +++ b/test/automated/stream_name/compose/missing_category_error.rb @@ -1,4 +1,4 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do diff --git a/test/automated/stream_name/compose/singular_ids.rb b/test/automated/stream_name/compose/singular_ids.rb index 7520089..9996850 100644 --- a/test/automated/stream_name/compose/singular_ids.rb +++ b/test/automated/stream_name/compose/singular_ids.rb @@ -1,45 +1,45 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do context "Singular IDs" do context "Positional ID" do - stream_name = StreamName.stream_name('someCategory', 'some_positional_id') + stream_name = StreamName.stream_name("someCategory", "some_positional_id") test "Stream name is the category and the positional ID" do - assert(stream_name == 'someCategory-some_positional_id') + assert(stream_name == "someCategory-some_positional_id") end end context "Named ID Argument" do - stream_name = StreamName.stream_name('someCategory', id: 'some_named_id') + stream_name = StreamName.stream_name("someCategory", id: "some_named_id") test "Stream name is the category and the named ID" do - assert(stream_name == 'someCategory-some_named_id') + assert(stream_name == "someCategory-some_named_id") end end context "Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', ids: 'some_named_ids') + stream_name = StreamName.stream_name("someCategory", ids: "some_named_ids") test "Stream name is the category and the named IDs" do - assert(stream_name == 'someCategory-some_named_ids') + assert(stream_name == "someCategory-some_named_ids") end end context "Named ID and Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', id: 'some_named_id', ids: 'some_named_ids') + stream_name = StreamName.stream_name("someCategory", id: "some_named_id", ids: "some_named_ids") test "Stream name is the category, the cardinal ID, and the named ID" do - assert(stream_name == 'someCategory-some_named_id+some_named_ids') + assert(stream_name == "someCategory-some_named_id+some_named_ids") end end context "Positional ID, Named ID, and Named IDs Argument" do - stream_name = StreamName.stream_name('someCategory', 'some_positional_id', id: 'some_named_id', ids: 'some_named_ids') + stream_name = StreamName.stream_name("someCategory", "some_positional_id", id: "some_named_id", ids: "some_named_ids") test "Stream name is the category, the positional ID, the named ID, and the named IDs" do - assert(stream_name == 'someCategory-some_positional_id+some_named_id+some_named_ids') + assert(stream_name == "someCategory-some_positional_id+some_named_id+some_named_ids") end end end diff --git a/test/automated/stream_name/compose/stream_name.rb b/test/automated/stream_name/compose/stream_name.rb index 930e99e..c7e52ce 100644 --- a/test/automated/stream_name/compose/stream_name.rb +++ b/test/automated/stream_name/compose/stream_name.rb @@ -1,13 +1,13 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do context "Stream Name" do context "Category, Type, Types, Positional ID, Cardinal ID, Named ID, and Named IDs" do - stream_name = StreamName.stream_name('someCategory', 'some_id', cardinal_id: 'some_cardinal_id', id: 'some_named_id', ids: ['some_other_named_id', 'yet_another_named_id'], type: 'someType', types: ['someOtherType', 'yetAnotherType']) + stream_name = StreamName.stream_name("someCategory", "some_id", cardinal_id: "some_cardinal_id", id: "some_named_id", ids: ["some_other_named_id", "yet_another_named_id"], type: "someType", types: ["someOtherType", "yetAnotherType"]) test "Stream name is the category, type, types, cardinal ID, positional ID, named ID, and named IDs" do - assert(stream_name == 'someCategory:someType+someOtherType+yetAnotherType-some_cardinal_id+some_id+some_named_id+some_other_named_id+yet_another_named_id') + assert(stream_name == "someCategory:someType+someOtherType+yetAnotherType-some_cardinal_id+some_id+some_named_id+some_other_named_id+yet_another_named_id") end end end diff --git a/test/automated/stream_name/compose/types.rb b/test/automated/stream_name/compose/types.rb index f1e889a..587a659 100644 --- a/test/automated/stream_name/compose/types.rb +++ b/test/automated/stream_name/compose/types.rb @@ -1,56 +1,56 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Compose" do context "Types" do context "Singular Types" do context "Category and Type" do - stream_name = StreamName.stream_name('someCategory', type: 'someType') + stream_name = StreamName.stream_name("someCategory", type: "someType") test "Stream name is the category and the Type" do - assert(stream_name == 'someCategory:someType') + assert(stream_name == "someCategory:someType") end end context "Category and Types" do - stream_name = StreamName.stream_name('someCategory', types: 'someTypes') + stream_name = StreamName.stream_name("someCategory", types: "someTypes") test "Stream name is the category and the types" do - assert(stream_name == 'someCategory:someTypes') + assert(stream_name == "someCategory:someTypes") end end context "Category, Type, and Types" do - stream_name = StreamName.stream_name('someCategory', type: 'someType', types: 'someTypes') + stream_name = StreamName.stream_name("someCategory", type: "someType", types: "someTypes") test "Stream name is the category and the types" do - assert(stream_name == 'someCategory:someType+someTypes') + assert(stream_name == "someCategory:someType+someTypes") end end end context "Plural Types" do context "Category and Type" do - stream_name = StreamName.stream_name('someCategory', type: ['someType', 'someOtherType']) + stream_name = StreamName.stream_name("someCategory", type: ["someType", "someOtherType"]) test "Stream name is the category and the type" do - assert(stream_name == 'someCategory:someType+someOtherType') + assert(stream_name == "someCategory:someType+someOtherType") end end context "Category and Types" do - stream_name = StreamName.stream_name('someCategory', types: ['someType', 'someOtherType']) + stream_name = StreamName.stream_name("someCategory", types: ["someType", "someOtherType"]) test "Stream name is the category and the types" do - assert(stream_name == 'someCategory:someType+someOtherType') + assert(stream_name == "someCategory:someType+someOtherType") end end context "Category, Type, and Types" do - stream_name = StreamName.stream_name('someCategory', type: ['someType', 'someOtherType'], types: ['yetAnotherType', 'andAnotherType']) + stream_name = StreamName.stream_name("someCategory", type: ["someType", "someOtherType"], types: ["yetAnotherType", "andAnotherType"]) test "Stream name is the category and the types delimited by the plus (+) sign" do - assert(stream_name == 'someCategory:someType+someOtherType+yetAnotherType+andAnotherType') + assert(stream_name == "someCategory:someType+someOtherType+yetAnotherType+andAnotherType") end end end diff --git a/test/automated/stream_name/parse/get_cardinal_id.rb b/test/automated/stream_name/parse/get_cardinal_id.rb index 7593a9e..0bb012e 100644 --- a/test/automated/stream_name/parse/get_cardinal_id.rb +++ b/test/automated/stream_name/parse/get_cardinal_id.rb @@ -1,31 +1,31 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get Cardinal ID" do context "Compound ID in the Stream Name" do - id = 'some_id+some_other_id' + id = "some_id+some_other_id" stream_name = "someCategory-#{id}" cardinal_id = StreamName.get_cardinal_id(stream_name) test "ID is a list of values" do - assert(cardinal_id == 'some_id') + assert(cardinal_id == "some_id") end end context "Single ID in the Stream Name" do - id = 'some_id' + id = "some_id" stream_name = "someCategory-#{id}" cardinal_id = StreamName.get_cardinal_id(stream_name) test "ID list has a single entry" do - assert(cardinal_id == 'some_id') + assert(cardinal_id == "some_id") end end context "No ID in the Stream Name" do - stream_name = 'someStream' + stream_name = "someStream" cardinal_id = StreamName.get_cardinal_id(stream_name) diff --git a/test/automated/stream_name/parse/get_category.rb b/test/automated/stream_name/parse/get_category.rb index d023c43..0ba7318 100644 --- a/test/automated/stream_name/parse/get_category.rb +++ b/test/automated/stream_name/parse/get_category.rb @@ -1,8 +1,8 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get Category" do - category = 'someStream' + category = "someStream" context "Stream Name Contains an ID" do id = Identifier::UUID.random diff --git a/test/automated/stream_name/parse/get_category_type.rb b/test/automated/stream_name/parse/get_category_type.rb index a1d8087..1f7368f 100644 --- a/test/automated/stream_name/parse/get_category_type.rb +++ b/test/automated/stream_name/parse/get_category_type.rb @@ -1,4 +1,4 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get Type List" do @@ -8,7 +8,7 @@ type_list = StreamName.get_type(stream_name) test "Types are the list of elements following a colon separator" do - assert(type_list == 'someType+someOtherType') + assert(type_list == "someType+someOtherType") end end @@ -18,7 +18,7 @@ type_list = StreamName.get_type(stream_name) test "Types are the list of elements following a colon separator and preceding the ID" do - assert(type_list == 'someType+someOtherType') + assert(type_list == "someType+someOtherType") end end @@ -28,7 +28,7 @@ type_list = StreamName.get_type(stream_name) test "Types are the list of elements following a colon separator and preceding the ID" do - assert(type_list == 'someType') + assert(type_list == "someType") end end diff --git a/test/automated/stream_name/parse/get_category_types.rb b/test/automated/stream_name/parse/get_category_types.rb index 1c04c60..f150613 100644 --- a/test/automated/stream_name/parse/get_category_types.rb +++ b/test/automated/stream_name/parse/get_category_types.rb @@ -1,4 +1,4 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get Types" do @@ -8,7 +8,7 @@ types = StreamName.get_types(stream_name) - assert(types == ['someType', 'someOtherType']) + assert(types == ["someType", "someOtherType"]) end end @@ -18,7 +18,7 @@ types = StreamName.get_types(stream_name) - assert(types == ['someType', 'someOtherType']) + assert(types == ["someType", "someOtherType"]) end end @@ -28,12 +28,12 @@ types = StreamName.get_types(stream_name) - assert(types == ['someType']) + assert(types == ["someType"]) end end context "No type list in the stream name" do - types = StreamName.get_types('someStream') + types = StreamName.get_types("someStream") test "No types" do assert(types.empty?) diff --git a/test/automated/stream_name/parse/get_entity_name.rb b/test/automated/stream_name/parse/get_entity_name.rb index 0fa664e..60f51d8 100644 --- a/test/automated/stream_name/parse/get_entity_name.rb +++ b/test/automated/stream_name/parse/get_entity_name.rb @@ -1,8 +1,8 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get Entity Name" do - category = 'someStream' + category = "someStream" context "Stream Name Contains an ID" do id = Identifier::UUID.random diff --git a/test/automated/stream_name/parse/get_id.rb b/test/automated/stream_name/parse/get_id.rb index 31510e9..fefda40 100644 --- a/test/automated/stream_name/parse/get_id.rb +++ b/test/automated/stream_name/parse/get_id.rb @@ -1,20 +1,20 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get ID" do context "Single ID in the Stream Name" do - id = 'some_id' + id = "some_id" stream_name = "someCategory-#{id}" stream_id = StreamName.get_id(stream_name) test "ID value is parsed" do - assert(stream_id == 'some_id') + assert(stream_id == "some_id") end end context "No ID in the Stream Name" do - stream_id = StreamName.get_id('someStream') + stream_id = StreamName.get_id("someStream") test "ID is nil" do assert(stream_id.nil?) diff --git a/test/automated/stream_name/parse/get_ids.rb b/test/automated/stream_name/parse/get_ids.rb index 8ad5ce1..99ead92 100644 --- a/test/automated/stream_name/parse/get_ids.rb +++ b/test/automated/stream_name/parse/get_ids.rb @@ -1,31 +1,31 @@ -require_relative '../../automated_init' +require_relative "../../automated_init" context "Stream Name" do context "Get IDs" do context "Compound ID in the Stream Name" do - id = 'some_id+some_other_id' + id = "some_id+some_other_id" stream_name = "someCategory-#{id}" stream_ids = StreamName.get_ids(stream_name) test "ID is a list of values" do - assert(stream_ids == ['some_id', 'some_other_id']) + assert(stream_ids == ["some_id", "some_other_id"]) end end context "Single ID in the Stream Name" do - id = 'some_id' + id = "some_id" stream_name = "someCategory-#{id}" stream_ids = StreamName.get_ids(stream_name) test "ID list has a single entry" do - assert(stream_ids == ['some_id']) + assert(stream_ids == ["some_id"]) end end context "No ID in the Stream Name" do - stream_name = 'someStream' + stream_name = "someStream" stream_ids = StreamName.get_ids(stream_name) diff --git a/test/automated/write/ids_are_assigned.rb b/test/automated/write/ids_are_assigned.rb index d75a3d2..887fe93 100644 --- a/test/automated/write/ids_are_assigned.rb +++ b/test/automated/write/ids_are_assigned.rb @@ -1,4 +1,4 @@ -require_relative '../automated_init' +require_relative "../automated_init" context "Write" do stream_name = Controls::StreamName.example diff --git a/test/test_init.rb b/test/test_init.rb index a895fe5..c8f5bd2 100644 --- a/test/test_init.rb +++ b/test/test_init.rb @@ -1,21 +1,21 @@ -ENV['CONSOLE_DEVICE'] ||= 'stdout' -ENV['LOG_COLOR'] ||= 'on' +ENV["CONSOLE_DEVICE"] ||= "stdout" +ENV["LOG_COLOR"] ||= "on" -if ENV['LOG_LEVEL'] - ENV['LOGGER'] ||= 'on' +if ENV["LOG_LEVEL"] + ENV["LOGGER"] ||= "on" else - ENV['LOG_LEVEL'] ||= 'trace' + ENV["LOG_LEVEL"] ||= "trace" end -ENV['LOGGER'] ||= 'off' -ENV['LOG_OPTIONAL'] ||= 'on' +ENV["LOGGER"] ||= "off" +ENV["LOG_OPTIONAL"] ||= "on" puts RUBY_DESCRIPTION -require_relative '../init.rb' +require_relative "../init.rb" -require 'test_bench'; TestBench.activate +require "test_bench"; TestBench.activate -require 'message_store/controls' +require "message_store/controls" include MessageStore