diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a7c821..636a764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,30 +1,31 @@ - [\[Unreleased\]](#unreleased) + - [Changed](#changed) - [\[0.11.0\] - 2024-01-02](#0110---2024-01-02) - [Added](#added) - - [Changed](#changed) + - [Changed](#changed-1) - [\[0.10.0\] - 2023-12-31](#0100---2023-12-31) - [Added](#added-1) - [\[0.9.1\] - 2023-12-12](#091---2023-12-12) - - [Changed](#changed-1) + - [Changed](#changed-2) - [Fixed](#fixed) - [\[0.9.0\] - 2023-12-12](#090---2023-12-12) - [Added](#added-2) - - [Changed](#changed-2) + - [Changed](#changed-3) - [\[0.8.0\] - 2023-12-11](#080---2023-12-11) - [Added](#added-3) - - [Changed](#changed-3) + - [Changed](#changed-4) - [Removed](#removed) - [\[0.7.0\] - 2023-10-27](#070---2023-10-27) - [Added](#added-4) - - [Changed](#changed-4) + - [Changed](#changed-5) - [\[0.6.0\] - 2023-10-11](#060---2023-10-11) - [Added](#added-5) - - [Changed](#changed-5) + - [Changed](#changed-6) - [\[0.5.0\] - 2023-10-09](#050---2023-10-09) - [Added](#added-6) - [\[0.4.0\] - 2023-09-28](#040---2023-09-28) - [Added](#added-7) - - [Changed](#changed-6) + - [Changed](#changed-7) - [Removed](#removed-1) - [\[0.3.0\] - 2023-09-26](#030---2023-09-26) - [Added](#added-8) @@ -36,6 +37,14 @@ ## [Unreleased] +### Changed + +- **(BREAKING)** Renames the subject concept/term to `source`. When a mixin is included/extended, it defines the `Success()` and `Failure()` methods. Since the results are generated in a context (instance or singleton where the mixin was used), they will have a defined source (instance or singleton itself). + > Definition of source + > + > From dictionary: + > * a place, person, or thing from which something comes or can be obtained. + ## [0.11.0] - 2024-01-02 ### Added @@ -45,6 +54,14 @@ ### Changed - **(BREAKING)** Rename halted concept to terminal. Failures are terminal by default, but you can make a success terminal by enabling the `:continue` addon. + > Definition of terminal + > + > From dictionary: + > * of, forming, or situated at the end or extremity of something. + > * the end of a railroad or other transport route, or a station at such a point. + > + > From Wikipedia: + > * A "terminus" or "terminal" is a station at the end of a railway line. - **(BREAKING)** Rename `BCDD::Result::Context::Success#and_expose` halted keyword argument to `terminal`. diff --git a/README.md b/README.md index 167a01a..3e56ca5 100644 --- a/README.md +++ b/README.md @@ -649,9 +649,9 @@ Divide.call(2, 2) This method generates a module that any object can include or extend. It adds two methods to the target object: `Success()` and `Failure()`. -The main difference between these methods and `BCDD::Result::Success()`/`BCDD::Result::Failure()` is that the former will utilize the target object (which has received the include/extend) as the result's subject. +The main difference between these methods and `BCDD::Result::Success()`/`BCDD::Result::Failure()` is that the former will utilize the target object (which has received the include/extend) as the result's source. -Because the result has a subject, the `#and_then` method can call methods from it. +Because the result has a source, the `#and_then` method can call methods from it. ##### Class example (Instance Methods) @@ -746,9 +746,9 @@ Divide.call(4, '2') # ``` -In order to fix this, you must handle the result produced by `ValidateNonzero.call()` and return a result that belongs to the subject. +In order to fix this, you must handle the result produced by `ValidateNonzero.call()` and return a result that belongs to the same source. ```ruby module ValidateNonzero @@ -832,7 +832,8 @@ module Divide end def validate_nonzero(numbers) - # In this case we are handling the other subject result and returning our own + # In this case we are handling the result from other source + # and returning our own ValidateNonzero.call(numbers).handle do |on| on.success { |numbers| Success(:ok, numbers) } @@ -858,8 +859,8 @@ Divide.call(2, 0) ##### Dependency Injection -The `BCDD::Result#and_then` accepts a second argument that will be used to share a value with the subject's method. -To receive this argument, the subject's method must have an arity of two, where the first argument will be the result value and the second will be the shared value. +The `BCDD::Result#and_then` accepts a second argument that will be used to share a value with the source's method. +To receive this argument, the source's method must have an arity of two, where the first argument will be the result value and the second will be the injected value. ```ruby require 'logger' @@ -1863,7 +1864,7 @@ result.transitions :parent=>{:id=>0, :name=>"SumDivisionsByTwo", :desc=>nil}, :current=>{:id=>1, :name=>"Division", :desc=>"divide two numbers"}, :result=>{:kind=>:success, :type=>:continued, :value=>[20, 2]}, - :and_then=>{:type=>:method, :arg=>nil, :subject=>, :method_name=>:require_numbers}, + :and_then=>{:type=>:method, :arg=>nil, :source=>, :method_name=>:require_numbers}, :time=>2024-01-02 03:35:11.248558 UTC }, { @@ -1871,7 +1872,7 @@ result.transitions :parent=>{:id=>0, :name=>"SumDivisionsByTwo", :desc=>nil}, :current=>{:id=>1, :name=>"Division", :desc=>"divide two numbers"}, :result=>{:kind=>:success, :type=>:continued, :value=>[20, 2]}, - :and_then=>{:type=>:method, :arg=>nil, :subject=>, :method_name=>:check_for_zeros}, + :and_then=>{:type=>:method, :arg=>nil, :source=>, :method_name=>:check_for_zeros}, :time=>2024-01-02 03:35:11.248587 UTC }, { @@ -1879,7 +1880,7 @@ result.transitions :parent=>{:id=>0, :name=>"SumDivisionsByTwo", :desc=>nil}, :current=>{:id=>1, :name=>"Division", :desc=>"divide two numbers"}, :result=>{:kind=>:success, :type=>:division_completed, :value=>10}, - :and_then=>{:type=>:method, :arg=>nil, :subject=>, :method_name=>:divide}, + :and_then=>{:type=>:method, :arg=>nil, :source=>, :method_name=>:divide}, :time=>2024-01-02 03:35:11.248607 UTC }, { @@ -1895,7 +1896,7 @@ result.transitions :parent=>{:id=>0, :name=>"SumDivisionsByTwo", :desc=>nil}, :current=>{:id=>2, :name=>"Division", :desc=>"divide two numbers"}, :result=>{:kind=>:success, :type=>:continued, :value=>[10, 2]}, - :and_then=>{:type=>:method, :arg=>nil, :subject=>, :method_name=>:require_numbers}, + :and_then=>{:type=>:method, :arg=>nil, :source=>, :method_name=>:require_numbers}, :time=>2024-01-02 03:35:11.248661 UTC }, { @@ -1903,7 +1904,7 @@ result.transitions :parent=>{:id=>0, :name=>"SumDivisionsByTwo", :desc=>nil}, :current=>{:id=>2, :name=>"Division", :desc=>"divide two numbers"}, :result=>{:kind=>:success, :type=>:continued, :value=>[10, 2]}, - :and_then=>{:type=>:method, :arg=>nil, :subject=>, :method_name=>:check_for_zeros}, + :and_then=>{:type=>:method, :arg=>nil, :source=>, :method_name=>:check_for_zeros}, :time=>2024-01-02 03:35:11.248672 UTC }, { @@ -1911,7 +1912,7 @@ result.transitions :parent=>{:id=>0, :name=>"SumDivisionsByTwo", :desc=>nil}, :current=>{:id=>2, :name=>"Division", :desc=>"divide two numbers"}, :result=>{:kind=>:success, :type=>:division_completed, :value=>5}, - :and_then=>{:type=>:method, :arg=>nil, :subject=>, :method_name=>:divide}, + :and_then=>{:type=>:method, :arg=>nil, :source=>, :method_name=>:divide}, :time=>2024-01-02 03:35:11.248682 UTC }, { diff --git a/lib/bcdd/result.rb b/lib/bcdd/result.rb index 41661b5..42607bf 100644 --- a/lib/bcdd/result.rb +++ b/lib/bcdd/result.rb @@ -16,9 +16,9 @@ class BCDD::Result attr_accessor :unknown, :transitions - attr_reader :subject, :data, :type_checker, :terminal + attr_reader :source, :data, :type_checker, :terminal - protected :subject + protected :source private :unknown, :unknown=, :type_checker, :transitions= @@ -32,11 +32,11 @@ def self.configuration config.freeze end - def initialize(type:, value:, subject: nil, expectations: nil, terminal: nil) + def initialize(type:, value:, source: nil, expectations: nil, terminal: nil) data = Data.new(kind, type, value) @type_checker = Contract.evaluate(data, expectations) - @subject = subject + @source = source @terminal = terminal || kind == :failure @data = data @@ -93,7 +93,7 @@ def and_then(method_name = nil, context = nil, &block) method_name && block and raise ::ArgumentError, 'method_name and block are mutually exclusive' - method_name ? call_and_then_subject_method(method_name, context) : call_and_then_block(block) + method_name ? call_and_then_source_method(method_name, context) : call_and_then_block(block) end def handle @@ -139,27 +139,27 @@ def known(block) block.call(value, type) end - def call_and_then_subject_method(method_name, context_data) - method = subject.method(method_name) + def call_and_then_source_method(method_name, injected_value) + method = source.method(method_name) - Transitions.tracking.record_and_then(method, context_data, subject) do - result = call_and_then_subject_method!(method, context_data) + Transitions.tracking.record_and_then(method, injected_value, source) do + result = call_and_then_source_method!(method, injected_value) ensure_result_object(result, origin: :method) end end - def call_and_then_subject_method!(method, context_data) + def call_and_then_source_method!(method, injected_value) case method.arity - when 0 then subject.send(method.name) - when 1 then subject.send(method.name, value) - when 2 then subject.send(method.name, value, context_data) - else raise Error::InvalidSubjectMethodArity.build(subject: subject, method: method, max_arity: 2) + when 0 then source.send(method.name) + when 1 then source.send(method.name, value) + when 2 then source.send(method.name, value, injected_value) + else raise Error::InvalidSourceMethodArity.build(source: source, method: method, max_arity: 2) end end def call_and_then_block(block) - Transitions.tracking.record_and_then(:block, nil, subject) do + Transitions.tracking.record_and_then(:block, nil, source) do result = call_and_then_block!(block) ensure_result_object(result, origin: :block) @@ -173,8 +173,8 @@ def call_and_then_block!(block) def ensure_result_object(result, origin:) raise Error::UnexpectedOutcome.build(outcome: result, origin: origin) unless result.is_a?(::BCDD::Result) - return result if result.subject.equal?(subject) + return result if result.source.equal?(source) - raise Error::InvalidResultSubject.build(given_result: result, expected_subject: subject) + raise Error::InvalidResultSource.build(given_result: result, expected_source: source) end end diff --git a/lib/bcdd/result/context.rb b/lib/bcdd/result/context.rb index 4ebd63c..a070f15 100644 --- a/lib/bcdd/result/context.rb +++ b/lib/bcdd/result/context.rb @@ -15,7 +15,7 @@ def self.Failure(type, **value) Failure.new(type: type, value: value) end - def initialize(type:, value:, subject: nil, expectations: nil, terminal: nil) + def initialize(type:, value:, source: nil, expectations: nil, terminal: nil) value.is_a?(::Hash) or raise ::ArgumentError, 'value must be a Hash' @acc = {} @@ -23,8 +23,8 @@ def initialize(type:, value:, subject: nil, expectations: nil, terminal: nil) super end - def and_then(method_name = nil, **context_data, &block) - super(method_name, context_data, &block) + def and_then(method_name = nil, **injected_value, &block) + super(method_name, injected_value, &block) end protected @@ -33,20 +33,20 @@ def and_then(method_name = nil, **context_data, &block) private - SubjectMethodArity = ->(method) do + SourceMethodArity = ->(method) do return 0 if method.arity.zero? return 1 if method.parameters.map(&:first).all?(/\Akey/) -1 end - def call_and_then_subject_method!(method, context_data) - acc.merge!(value.merge(context_data)) + def call_and_then_source_method!(method, injected_value) + acc.merge!(value.merge(injected_value)) - case SubjectMethodArity[method] - when 0 then subject.send(method.name) - when 1 then subject.send(method.name, **acc) - else raise Error::InvalidSubjectMethodArity.build(subject: subject, method: method, max_arity: 1) + case SourceMethodArity[method] + when 0 then source.send(method.name) + when 1 then source.send(method.name, **acc) + else raise Error::InvalidSourceMethodArity.build(source: source, method: method, max_arity: 1) end end @@ -59,9 +59,9 @@ def call_and_then_block!(block) def ensure_result_object(result, origin:) raise_unexpected_outcome_error(result, origin) unless result.is_a?(Context) - return result.tap { _1.acc.merge!(acc) } if result.subject.equal?(subject) + return result.tap { _1.acc.merge!(acc) } if result.source.equal?(source) - raise Error::InvalidResultSubject.build(given_result: result, expected_subject: subject) + raise Error::InvalidResultSource.build(given_result: result, expected_source: source) end EXPECTED_OUTCOME = 'BCDD::Result::Context::Success or BCDD::Result::Context::Failure' @@ -70,6 +70,6 @@ def raise_unexpected_outcome_error(result, origin) raise Error::UnexpectedOutcome.build(outcome: result, origin: origin, expected: EXPECTED_OUTCOME) end - private_constant :SubjectMethodArity, :EXPECTED_OUTCOME + private_constant :SourceMethodArity, :EXPECTED_OUTCOME end end diff --git a/lib/bcdd/result/context/expectations/mixin.rb b/lib/bcdd/result/context/expectations/mixin.rb index 1545f43..38c2942 100644 --- a/lib/bcdd/result/context/expectations/mixin.rb +++ b/lib/bcdd/result/context/expectations/mixin.rb @@ -9,7 +9,7 @@ module Expectations::Mixin module Addons module Continue private def Continue(**value) - Success.new(type: :continued, value: value, subject: self) + Success.new(type: :continued, value: value, source: self) end end @@ -17,7 +17,7 @@ module Given private def Given(*values) value = values.map(&:to_h).reduce({}) { |acc, val| acc.merge(val) } - Success.new(type: :given, value: value, subject: self) + Success.new(type: :given, value: value, source: self) end end diff --git a/lib/bcdd/result/context/mixin.rb b/lib/bcdd/result/context/mixin.rb index 2a5337f..3c30e36 100644 --- a/lib/bcdd/result/context/mixin.rb +++ b/lib/bcdd/result/context/mixin.rb @@ -14,7 +14,7 @@ def Failure(type, **value) end private def _ResultAs(kind_class, type, value, terminal: nil) - kind_class.new(type: type, value: value, subject: self, terminal: terminal) + kind_class.new(type: type, value: value, source: self, terminal: terminal) end end diff --git a/lib/bcdd/result/context/success.rb b/lib/bcdd/result/context/success.rb index 908314f..7c1baae 100644 --- a/lib/bcdd/result/context/success.rb +++ b/lib/bcdd/result/context/success.rb @@ -10,6 +10,6 @@ def and_expose(type, keys, terminal: true) exposed_value = acc.merge(value).slice(*keys) - self.class.new(type: type, value: exposed_value, subject: subject, terminal: terminal) + self.class.new(type: type, value: exposed_value, source: source, terminal: terminal) end end diff --git a/lib/bcdd/result/error.rb b/lib/bcdd/result/error.rb index a89c1cb..61fc448 100644 --- a/lib/bcdd/result/error.rb +++ b/lib/bcdd/result/error.rb @@ -22,29 +22,29 @@ def self.build(outcome:, origin:, expected: nil) end end - class InvalidResultSubject < self - def self.build(given_result:, expected_subject:) + class InvalidResultSource < self + def self.build(given_result:, expected_source:) message = - "You cannot call #and_then and return a result that does not belong to the subject!\n" \ - "Expected subject: #{expected_subject.inspect}\n" \ - "Given subject: #{given_result.send(:subject).inspect}\n" \ + "You cannot call #and_then and return a result that does not belong to the same source!\n" \ + "Expected source: #{expected_source.inspect}\n" \ + "Given source: #{given_result.send(:source).inspect}\n" \ "Given result: #{given_result.inspect}" new(message) end end - class InvalidSubjectMethodArity < self - def self.build(subject:, method:, max_arity:) - new("#{subject.class}##{method.name} has unsupported arity (#{method.arity}). Expected 0..#{max_arity}") + class InvalidSourceMethodArity < self + def self.build(source:, method:, max_arity:) + new("#{source.class}##{method.name} has unsupported arity (#{method.arity}). Expected 0..#{max_arity}") end end class UnhandledTypes < self def self.build(types:) - subject = types.size == 1 ? 'This was' : 'These were' + source = types.size == 1 ? 'This was' : 'These were' - new("You must handle all cases. #{subject} not handled: #{types.map(&:inspect).join(', ')}") + new("You must handle all cases. #{source} not handled: #{types.map(&:inspect).join(', ')}") end end end diff --git a/lib/bcdd/result/expectations.rb b/lib/bcdd/result/expectations.rb index a803739..3135659 100644 --- a/lib/bcdd/result/expectations.rb +++ b/lib/bcdd/result/expectations.rb @@ -38,10 +38,10 @@ def self.new(...) private_class_method :mixin!, :mixin_module, :result_factory_without_expectations - def initialize(subject: nil, contract: nil, terminal: nil, **options) + def initialize(source: nil, contract: nil, terminal: nil, **options) @terminal = terminal - @subject = subject + @source = source @contract = contract if contract.is_a?(Contract::Evaluator) @@ -60,16 +60,16 @@ def Failure(type, value = nil) _ResultAs(Failure, type, value) end - def with(subject:, terminal: nil) - self.class.new(subject: subject, terminal: terminal, contract: contract) + def with(source:, terminal: nil) + self.class.new(source: source, terminal: terminal, contract: contract) end private def _ResultAs(kind_class, type, value) - kind_class.new(type: type, value: value, subject: subject, expectations: contract, terminal: terminal) + kind_class.new(type: type, value: value, source: source, expectations: contract, terminal: terminal) end - attr_reader :subject, :terminal, :contract + attr_reader :source, :terminal, :contract end end diff --git a/lib/bcdd/result/expectations/mixin.rb b/lib/bcdd/result/expectations/mixin.rb index c469079..8915536 100644 --- a/lib/bcdd/result/expectations/mixin.rb +++ b/lib/bcdd/result/expectations/mixin.rb @@ -24,7 +24,7 @@ def Failure(...) FACTORY = <<~RUBY private def _Result - @_Result ||= Result.with(subject: self, terminal: %s) + @_Result ||= Result.with(source: self, terminal: %s) end RUBY @@ -38,13 +38,13 @@ def self.to_eval(addons) module Addons module Continue private def Continue(value) - Success.new(type: :continued, value: value, subject: self) + Success.new(type: :continued, value: value, source: self) end end module Given private def Given(value) - Success.new(type: :given, value: value, subject: self) + Success.new(type: :given, value: value, source: self) end end diff --git a/lib/bcdd/result/mixin.rb b/lib/bcdd/result/mixin.rb index 7a60650..1a0cd27 100644 --- a/lib/bcdd/result/mixin.rb +++ b/lib/bcdd/result/mixin.rb @@ -21,7 +21,7 @@ def Failure(type, value = nil) end private def _ResultAs(kind_class, type, value, terminal: nil) - kind_class.new(type: type, value: value, subject: self, terminal: terminal) + kind_class.new(type: type, value: value, source: self, terminal: terminal) end end diff --git a/lib/bcdd/result/transitions/tracking/disabled.rb b/lib/bcdd/result/transitions/tracking/disabled.rb index 7fa8b7a..7acf7ed 100644 --- a/lib/bcdd/result/transitions/tracking/disabled.rb +++ b/lib/bcdd/result/transitions/tracking/disabled.rb @@ -10,7 +10,7 @@ def self.reset!; end def self.record(result); end - def self.record_and_then(_type, _data, _subject) + def self.record_and_then(_type, _data, _source) yield end end diff --git a/lib/bcdd/result/transitions/tracking/enabled.rb b/lib/bcdd/result/transitions/tracking/enabled.rb index b5b1ad2..4f43235 100644 --- a/lib/bcdd/result/transitions/tracking/enabled.rb +++ b/lib/bcdd/result/transitions/tracking/enabled.rb @@ -38,11 +38,11 @@ def record(result) track(result, time: ::Time.now.getutc) end - def record_and_then(type_arg, arg, subject) + def record_and_then(type_arg, arg, source) type = type_arg.instance_of?(::Method) ? :method : type_arg unless tree.frozen? - current_and_then = { type: type, arg: arg, subject: subject } + current_and_then = { type: type, arg: arg, source: source } current_and_then[:method_name] = type_arg.name if type == :method tree.current.value[1] = current_and_then diff --git a/sig/bcdd/result.rbs b/sig/bcdd/result.rbs index 011ff04..5612c84 100644 --- a/sig/bcdd/result.rbs +++ b/sig/bcdd/result.rbs @@ -4,7 +4,7 @@ class BCDD::Result private attr_reader type_checker: BCDD::Result::Contract::TypeChecker attr_reader data: BCDD::Result::Data - attr_reader subject: untyped + attr_reader source: untyped attr_reader terminal: bool attr_reader transitions: Hash[Symbol, untyped] @@ -14,7 +14,7 @@ class BCDD::Result def initialize: ( type: Symbol, value: untyped, - ?subject: untyped, + ?source: untyped, ?expectations: BCDD::Result::Contract::Evaluator, ?terminal: bool ) -> void @@ -51,8 +51,8 @@ class BCDD::Result def kind: -> Symbol def known: (Proc) -> untyped - def call_and_then_subject_method: (Symbol, untyped) -> BCDD::Result - def call_and_then_subject_method!: (untyped, untyped) -> BCDD::Result + def call_and_then_source_method: (Symbol, untyped) -> BCDD::Result + def call_and_then_source_method!: (untyped, untyped) -> BCDD::Result def call_and_then_block: (untyped) -> BCDD::Result def call_and_then_block!: (untyped) -> BCDD::Result def ensure_result_object: (untyped, origin: Symbol) -> BCDD::Result diff --git a/sig/bcdd/result/context.rbs b/sig/bcdd/result/context.rbs index 0b360e9..ac98d71 100644 --- a/sig/bcdd/result/context.rbs +++ b/sig/bcdd/result/context.rbs @@ -1,14 +1,14 @@ class BCDD::Result::Context < BCDD::Result EXPECTED_OUTCOME: String - SubjectMethodArity: ^(Method) -> Integer + SourceMethodArity: ^(Method) -> Integer attr_reader acc: Hash[Symbol, untyped] def initialize: ( type: Symbol, value: untyped, - ?subject: untyped, + ?source: untyped, ?expectations: BCDD::Result::Contract::Evaluator, ?terminal: bool ) -> void @@ -17,7 +17,7 @@ class BCDD::Result::Context < BCDD::Result private - def call_and_then_subject_method: (Symbol, Hash[Symbol, untyped]) -> BCDD::Result::Context + def call_and_then_source_method: (Symbol, Hash[Symbol, untyped]) -> BCDD::Result::Context def ensure_result_object: (untyped, origin: Symbol) -> BCDD::Result::Context def raise_unexpected_outcome_error: (BCDD::Result::Context | untyped, Symbol) -> void diff --git a/sig/bcdd/result/error.rbs b/sig/bcdd/result/error.rbs index b91836f..9711384 100644 --- a/sig/bcdd/result/error.rbs +++ b/sig/bcdd/result/error.rbs @@ -13,14 +13,14 @@ class BCDD::Result -> BCDD::Result::Error::UnexpectedOutcome end - class InvalidResultSubject < BCDD::Result::Error - def self.build: (given_result: BCDD::Result, expected_subject: untyped) - -> BCDD::Result::Error::InvalidResultSubject + class InvalidResultSource < BCDD::Result::Error + def self.build: (given_result: BCDD::Result, expected_source: untyped) + -> BCDD::Result::Error::InvalidResultSource end - class InvalidSubjectMethodArity < BCDD::Result::Error - def self.build: (subject: untyped, method: Method, max_arity: Integer) - -> BCDD::Result::Error::InvalidSubjectMethodArity + class InvalidSourceMethodArity < BCDD::Result::Error + def self.build: (source: untyped, method: Method, max_arity: Integer) + -> BCDD::Result::Error::InvalidSourceMethodArity end class UnhandledTypes < BCDD::Result::Error diff --git a/sig/bcdd/result/expectations.rbs b/sig/bcdd/result/expectations.rbs index cfee370..0c1b399 100644 --- a/sig/bcdd/result/expectations.rbs +++ b/sig/bcdd/result/expectations.rbs @@ -16,14 +16,14 @@ class BCDD::Result::Expectations def self.result_factory_without_expectations: -> singleton(BCDD::Result) def self.new: ( - ?subject: untyped, + ?source: untyped, ?contract: BCDD::Result::Contract::Evaluator, ?terminal: bool, **untyped ) -> (BCDD::Result::Expectations | untyped) def initialize: ( - ?subject: untyped, + ?source: untyped, ?contract: BCDD::Result::Contract::Evaluator, ?terminal: bool, **untyped @@ -32,13 +32,13 @@ class BCDD::Result::Expectations def Success: (Symbol, ?untyped) -> BCDD::Result::Success def Failure: (Symbol, ?untyped) -> BCDD::Result::Failure - def with: (subject: untyped) -> BCDD::Result::Expectations + def with: (source: untyped) -> BCDD::Result::Expectations private def _ResultAs: (singleton(BCDD::Result), Symbol, untyped) -> untyped - attr_reader subject: untyped + attr_reader source: untyped attr_reader contract: BCDD::Result::Contract::Evaluator attr_reader terminal: bool end diff --git a/test/bcdd/result/and_then/with_subject_test.rb b/test/bcdd/result/and_then/with_source_test.rb similarity index 65% rename from test/bcdd/result/and_then/with_subject_test.rb rename to test/bcdd/result/and_then/with_source_test.rb index 8810ee6..dc4b91e 100644 --- a/test/bcdd/result/and_then/with_subject_test.rb +++ b/test/bcdd/result/and_then/with_source_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class AndThenWithSubjectTest < Minitest::Test + class AndThenWithSourceTest < Minitest::Test class Base include BCDD::Result.mixin @@ -25,7 +25,7 @@ def validate_numbers end end - class SubjectMethodArityWithArityZero < Base + class SourceMethodArityWithArityZero < Base def call validate_numbers.and_then(:add) end @@ -37,7 +37,7 @@ def add end end - class SubjectMethodArityWithArityOne < Base + class SourceMethodArityWithArityOne < Base def call validate_numbers .and_then { Success(:ok, [arg1, arg2]) } @@ -49,7 +49,7 @@ def add((number1, number2)) end end - class SubjectMethodArityWithArityTwo < Base + class SourceMethodArityWithArityTwo < Base def call context = { number: 3 } @@ -63,7 +63,7 @@ def add((number1, number2), context) end end - class InvalidSubjectMethodArity < Base + class InvalidSourceMethodArity < Base def call validate_numbers.and_then(:add) end @@ -73,9 +73,9 @@ def add(number1, number2, _number3) end end - class InvalidResultSubjectFromBlock < Base + class InvalidResultSourceFromBlock < Base def add_instance - @add_instance ||= SubjectMethodArityWithArityZero.new(arg1, arg2) + @add_instance ||= SourceMethodArityWithArityZero.new(arg1, arg2) end def call @@ -83,9 +83,9 @@ def call end end - class InvalidResultSubjectFromMethod < Base + class InvalidResultSourceFromMethod < Base def add_instance - @add_instance ||= SubjectMethodArityWithArityZero.new(arg1, arg2) + @add_instance ||= SourceMethodArityWithArityZero.new(arg1, arg2) end def call @@ -113,63 +113,63 @@ def add end end - test '#and_then calling a subject method (arity 0)' do - result = SubjectMethodArityWithArityZero.new(1, 2).call + test '#and_then calling a source method (arity 0)' do + result = SourceMethodArityWithArityZero.new(1, 2).call assert_predicate(result, :success?) assert_equal(:number, result.type) assert_equal(3, result.value) end - test '#and_then calling a subject method (arity 1)' do - result = SubjectMethodArityWithArityOne.new(1, 2).call + test '#and_then calling a source method (arity 1)' do + result = SourceMethodArityWithArityOne.new(1, 2).call assert_predicate(result, :success?) assert_equal(:number, result.type) assert_equal(3, result.value) end - test '#and_then calling a subject method (arity 2)' do - result = SubjectMethodArityWithArityTwo.new(1, 2).call + test '#and_then calling a source method (arity 2)' do + result = SourceMethodArityWithArityTwo.new(1, 2).call assert_predicate(result, :success?) assert_equal(:number, result.type) assert_equal(6, result.value) end - test '#and_then calling a subject method with wrong arity (> 2)' do - wrong_subject_method_arity = InvalidSubjectMethodArity.new(1, 2) + test '#and_then calling a source method with wrong arity (> 2)' do + wrong_source_method_arity = InvalidSourceMethodArity.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidSubjectMethodArity) { wrong_subject_method_arity.call } + error = assert_raises(BCDD::Result::Error::InvalidSourceMethodArity) { wrong_source_method_arity.call } - expected_message = "#{InvalidSubjectMethodArity}#add has unsupported arity (3). Expected 0..2" + expected_message = "#{InvalidSourceMethodArity}#add has unsupported arity (3). Expected 0..2" assert_equal(expected_message, error.message) end - test '#and_then raises an error when the block returns a result that does not belongs to the subject' do - wrong_result_subject = InvalidResultSubjectFromBlock.new(1, 2) + test '#and_then raises an error when the block returns a result that does not belongs to the source' do + wrong_result_source = InvalidResultSourceFromBlock.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidResultSubject) { wrong_result_subject.call } + error = assert_raises(BCDD::Result::Error::InvalidResultSource) { wrong_result_source.call } expected_message = - "You cannot call #and_then and return a result that does not belong to the subject!\n" \ - "Expected subject: #{wrong_result_subject.inspect}\n" \ - "Given subject: #{wrong_result_subject.add_instance.inspect}\n" \ + "You cannot call #and_then and return a result that does not belong to the same source!\n" \ + "Expected source: #{wrong_result_source.inspect}\n" \ + "Given source: #{wrong_result_source.add_instance.inspect}\n" \ 'Given result: #' assert_equal(expected_message, error.message) end - test '#and_then raises an error when the called method returns a result that does not belongs to the subject' do - wrong_result_subject = InvalidResultSubjectFromMethod.new(1, 2) + test '#and_then raises an error when the called method returns a result that does not belongs to the source' do + wrong_result_source = InvalidResultSourceFromMethod.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidResultSubject) { wrong_result_subject.call } + error = assert_raises(BCDD::Result::Error::InvalidResultSource) { wrong_result_source.call } expected_message = - "You cannot call #and_then and return a result that does not belong to the subject!\n" \ - "Expected subject: #{wrong_result_subject.inspect}\n" \ - "Given subject: #{wrong_result_subject.add_instance.inspect}\n" \ + "You cannot call #and_then and return a result that does not belong to the same source!\n" \ + "Expected source: #{wrong_result_source.inspect}\n" \ + "Given source: #{wrong_result_source.add_instance.inspect}\n" \ 'Given result: #' assert_equal(expected_message, error.message) diff --git a/test/bcdd/result/and_then/without_subject_test.rb b/test/bcdd/result/and_then/without_source_test.rb similarity index 97% rename from test/bcdd/result/and_then/without_subject_test.rb rename to test/bcdd/result/and_then/without_source_test.rb index 756fe22..f37a955 100644 --- a/test/bcdd/result/and_then/without_subject_test.rb +++ b/test/bcdd/result/and_then/without_source_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class AndThenWithoutSubjectTest < Minitest::Test + class AndThenWithoutSourceTest < Minitest::Test test '#and_then does not execute the block if the result is a failure' do result = Success diff --git a/test/bcdd/result/context/and_then/with_subject_test.rb b/test/bcdd/result/context/and_then/with_source_test.rb similarity index 65% rename from test/bcdd/result/context/and_then/with_subject_test.rb rename to test/bcdd/result/context/and_then/with_source_test.rb index e67f0e0..f00152d 100644 --- a/test/bcdd/result/context/and_then/with_subject_test.rb +++ b/test/bcdd/result/context/and_then/with_source_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class ContextAndThenWithSubjectTest < Minitest::Test + class ContextAndThenWithSourceTest < Minitest::Test class Base include BCDD::Result::Context.mixin @@ -25,7 +25,7 @@ def validate_numbers end end - class SubjectMethodArityWithArityZero < Base + class SourceMethodArityWithArityZero < Base def call validate_numbers.and_then(:add) end @@ -37,7 +37,7 @@ def add end end - class SubjectMethodArityWithArityOneKarg < Base + class SourceMethodArityWithArityOneKarg < Base def call validate_numbers .and_then { Success(:ok, number1: arg1, number2: arg2) } @@ -49,7 +49,7 @@ def add(number1:, number2:) end end - class SubjectMethodArityWithArityOneArg < Base + class SourceMethodArityWithArityOneArg < Base def call validate_numbers .and_then { Success(:ok, number1: arg1, number2: arg2) } @@ -61,7 +61,7 @@ def add(args) end end - class SubjectMethodArityWithContextData < Base + class SourceMethodArityWithContextData < Base def call validate_numbers .and_then { Success(:ok, number1: arg1, number2: arg2) } @@ -73,7 +73,7 @@ def add(number1:, number2:, number3:) end end - class InvalidSubjectMethodArity < Base + class InvalidSourceMethodArity < Base def call validate_numbers.and_then(:add) end @@ -83,9 +83,9 @@ def add(number1, number2) end end - class InvalidResultSubjectFromBlock < Base + class InvalidResultSourceFromBlock < Base def add_instance - @add_instance ||= SubjectMethodArityWithArityZero.new(arg1, arg2) + @add_instance ||= SourceMethodArityWithArityZero.new(arg1, arg2) end def call @@ -93,9 +93,9 @@ def call end end - class InvalidResultSubjectFromMethod < Base + class InvalidResultSourceFromMethod < Base def add_instance - @add_instance ||= SubjectMethodArityWithArityZero.new(arg1, arg2) + @add_instance ||= SourceMethodArityWithArityZero.new(arg1, arg2) end def call @@ -123,69 +123,69 @@ def add end end - test '#and_then calling a subject method (arity 0)' do - result = SubjectMethodArityWithArityZero.new(1, 2).call + test '#and_then calling a source method (arity 0)' do + result = SourceMethodArityWithArityZero.new(1, 2).call assert_predicate(result, :success?) assert_equal(:ok, result.type) assert_equal({ number: 3 }, result.value) end - test '#and_then calling a subject method (arity 1 - keyword args)' do - result = SubjectMethodArityWithArityOneKarg.new(1, 2).call + test '#and_then calling a source method (arity 1 - keyword args)' do + result = SourceMethodArityWithArityOneKarg.new(1, 2).call assert_predicate(result, :success?) assert_equal(:ok, result.type) assert_equal({ number: 3 }, result.value) end - test '#and_then calling a subject method with context data' do - result = SubjectMethodArityWithContextData.new(1, 2).call + test '#and_then calling a source method with context data' do + result = SourceMethodArityWithContextData.new(1, 2).call assert_predicate(result, :success?) assert_equal(:ok, result.type) assert_equal({ number: 6 }, result.value) end - test '#and_then calling a subject method (arity 1 - positional arg)' do - invalid_subject_method = SubjectMethodArityWithArityOneArg.new(1, 2) + test '#and_then calling a source method (arity 1 - positional arg)' do + invalid_source_method = SourceMethodArityWithArityOneArg.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidSubjectMethodArity) { invalid_subject_method.call } + error = assert_raises(BCDD::Result::Error::InvalidSourceMethodArity) { invalid_source_method.call } assert_match(/#add has unsupported arity \(1\). Expected 0..1\z/, error.message) end - test '#and_then calling a subject method with wrong arity (> 1)' do - wrong_subject_method_arity = InvalidSubjectMethodArity.new(1, 2) + test '#and_then calling a source method with wrong arity (> 1)' do + wrong_source_method_arity = InvalidSourceMethodArity.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidSubjectMethodArity) { wrong_subject_method_arity.call } + error = assert_raises(BCDD::Result::Error::InvalidSourceMethodArity) { wrong_source_method_arity.call } assert_match(/#add has unsupported arity \(2\). Expected 0..1\z/, error.message) end - test '#and_then raises an error when the block returns a result that does not belongs to the subject' do - wrong_result_subject = InvalidResultSubjectFromBlock.new(1, 2) + test '#and_then raises an error when the block returns a result that does not belongs to the source' do + wrong_result_source = InvalidResultSourceFromBlock.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidResultSubject) { wrong_result_subject.call } + error = assert_raises(BCDD::Result::Error::InvalidResultSource) { wrong_result_source.call } expected_message = - "You cannot call #and_then and return a result that does not belong to the subject!\n" \ - "Expected subject: #{wrong_result_subject.inspect}\n" \ - "Given subject: #{wrong_result_subject.add_instance.inspect}\n" \ + "You cannot call #and_then and return a result that does not belong to the same source!\n" \ + "Expected source: #{wrong_result_source.inspect}\n" \ + "Given source: #{wrong_result_source.add_instance.inspect}\n" \ 'Given result: #3}>' assert_equal(expected_message, error.message) end - test '#and_then raises an error when the called method returns a result that does not belongs to the subject' do - wrong_result_subject = InvalidResultSubjectFromMethod.new(1, 2) + test '#and_then raises an error when the called method returns a result that does not belongs to the source' do + wrong_result_source = InvalidResultSourceFromMethod.new(1, 2) - error = assert_raises(BCDD::Result::Error::InvalidResultSubject) { wrong_result_subject.call } + error = assert_raises(BCDD::Result::Error::InvalidResultSource) { wrong_result_source.call } expected_message = - "You cannot call #and_then and return a result that does not belong to the subject!\n" \ - "Expected subject: #{wrong_result_subject.inspect}\n" \ - "Given subject: #{wrong_result_subject.add_instance.inspect}\n" \ + "You cannot call #and_then and return a result that does not belong to the same source!\n" \ + "Expected source: #{wrong_result_source.inspect}\n" \ + "Given source: #{wrong_result_source.add_instance.inspect}\n" \ 'Given result: #3}>' assert_equal(expected_message, error.message) diff --git a/test/bcdd/result/context/and_then/without_subject_test.rb b/test/bcdd/result/context/and_then/without_source_test.rb similarity index 97% rename from test/bcdd/result/context/and_then/without_subject_test.rb rename to test/bcdd/result/context/and_then/without_source_test.rb index 0e562b7..af8b8ad 100644 --- a/test/bcdd/result/context/and_then/without_subject_test.rb +++ b/test/bcdd/result/context/and_then/without_source_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class ContextAndThenWithoutSubjectTest < Minitest::Test + class ContextAndThenWithoutSourceTest < Minitest::Test test '#and_then does not execute the block if the result is a failure' do result = Context::Success diff --git a/test/bcdd/result/context/expectations/with_subject/failure/type/invalid_type_test.rb b/test/bcdd/result/context/expectations/with_source/failure/type/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/with_subject/failure/type/invalid_type_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/type/invalid_type_test.rb index 55b73c6..ca55539 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/type/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureInvalidTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureInvalidTypeTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: :err diff --git a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value/invalid_type_test.rb b/test/bcdd/result/context/expectations/with_source/failure/type_and_value/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/with_subject/failure/type_and_value/invalid_type_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/type_and_value/invalid_type_test.rb index 42936a3..3e558a4 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureInvalidTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureInvalidTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: { diff --git a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value/invalid_value_test.rb b/test/bcdd/result/context/expectations/with_source/failure/type_and_value/invalid_value_test.rb similarity index 90% rename from test/bcdd/result/context/expectations/with_subject/failure/type_and_value/invalid_value_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/type_and_value/invalid_value_test.rb index de8560e..1cd476b 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureTypeAndValueInvalidValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: { diff --git a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/context/expectations/with_source/failure/type_and_value/pattern_matching_error_test.rb similarity index 91% rename from test/bcdd/result/context/expectations/with_subject/failure/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/type_and_value/pattern_matching_error_test.rb index c6a0c78..81b1d1c 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: { diff --git a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value_test.rb b/test/bcdd/result/context/expectations/with_source/failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/failure/type_and_value_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/type_and_value_test.rb index f4d5eb4..ba5b03b 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: { diff --git a/test/bcdd/result/context/expectations/with_subject/failure/type_test.rb b/test/bcdd/result/context/expectations/with_source/failure/type_test.rb similarity index 97% rename from test/bcdd/result/context/expectations/with_subject/failure/type_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/type_test.rb index bc67ee2..f5d1f16 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureTypeTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: :err diff --git a/test/bcdd/result/context/expectations/with_subject/failure/types/invalid_type_test.rb b/test/bcdd/result/context/expectations/with_source/failure/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/with_subject/failure/types/invalid_type_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/types/invalid_type_test.rb index 7faf122..71a439b 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/types/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureInvalidTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureInvalidTypesTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: %i[err1 err2] diff --git a/test/bcdd/result/context/expectations/with_subject/failure/types_test.rb b/test/bcdd/result/context/expectations/with_source/failure/types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/failure/types_test.rb rename to test/bcdd/result/context/expectations/with_source/failure/types_test.rb index cf46e88..0d6697d 100644 --- a/test/bcdd/result/context/expectations/with_subject/failure/types_test.rb +++ b/test/bcdd/result/context/expectations/with_source/failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectFailureTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceFailureTypesTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( failure: %i[invalid_arg division_by_zero] diff --git a/test/bcdd/result/context/expectations/with_subject/success/type/invalid_type_test.rb b/test/bcdd/result/context/expectations/with_source/success/type/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/with_subject/success/type/invalid_type_test.rb rename to test/bcdd/result/context/expectations/with_source/success/type/invalid_type_test.rb index 611c19d..2039bad 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/type/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessInvalidTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessInvalidTypeTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: :ok diff --git a/test/bcdd/result/context/expectations/with_subject/success/type_and_value/invalid_type_test.rb b/test/bcdd/result/context/expectations/with_source/success/type_and_value/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/with_subject/success/type_and_value/invalid_type_test.rb rename to test/bcdd/result/context/expectations/with_source/success/type_and_value/invalid_type_test.rb index a52c7f3..39a6d62 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessTypeAndValueInvalidTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessTypeAndValueInvalidTypeTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: { diff --git a/test/bcdd/result/context/expectations/with_subject/success/type_and_value/invalid_value_test.rb b/test/bcdd/result/context/expectations/with_source/success/type_and_value/invalid_value_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/with_subject/success/type_and_value/invalid_value_test.rb rename to test/bcdd/result/context/expectations/with_source/success/type_and_value/invalid_value_test.rb index ac9c4b1..89750c9 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessTypeAndValueInvalidValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: { diff --git a/test/bcdd/result/context/expectations/with_subject/success/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/context/expectations/with_source/success/type_and_value/pattern_matching_error_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/with_subject/success/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/context/expectations/with_source/success/type_and_value/pattern_matching_error_test.rb index e96648a..f561e28 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: { diff --git a/test/bcdd/result/context/expectations/with_subject/success/type_and_value_test.rb b/test/bcdd/result/context/expectations/with_source/success/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success/type_and_value_test.rb rename to test/bcdd/result/context/expectations/with_source/success/type_and_value_test.rb index 3e2d531..7e76c53 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: { diff --git a/test/bcdd/result/context/expectations/with_subject/success/type_test.rb b/test/bcdd/result/context/expectations/with_source/success/type_test.rb similarity index 97% rename from test/bcdd/result/context/expectations/with_subject/success/type_test.rb rename to test/bcdd/result/context/expectations/with_source/success/type_test.rb index 88d5175..4bcd810 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessTypeTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: :ok diff --git a/test/bcdd/result/context/expectations/with_subject/success/types/invalid_type_test.rb b/test/bcdd/result/context/expectations/with_source/success/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/with_subject/success/types/invalid_type_test.rb rename to test/bcdd/result/context/expectations/with_source/success/types/invalid_type_test.rb index 15f9d0c..7249888 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/types/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessInvalidTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessInvalidTypesTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: %i[ok1 ok2 ok3] diff --git a/test/bcdd/result/context/expectations/with_subject/success/types_test.rb b/test/bcdd/result/context/expectations/with_source/success/types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success/types_test.rb rename to test/bcdd/result/context/expectations/with_source/success/types_test.rb index 199cf30..8598e76 100644 --- a/test/bcdd/result/context/expectations/with_subject/success/types_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessTypesTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: %i[numbers division_completed] diff --git a/test/bcdd/result/context/expectations/with_subject/success_and_failure/mixed/type_and_value_with_types_test.rb b/test/bcdd/result/context/expectations/with_source/success_and_failure/mixed/type_and_value_with_types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success_and_failure/mixed/type_and_value_with_types_test.rb rename to test/bcdd/result/context/expectations/with_source/success_and_failure/mixed/type_and_value_with_types_test.rb index 07f6c3b..8697a97 100644 --- a/test/bcdd/result/context/expectations/with_subject/success_and_failure/mixed/type_and_value_with_types_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success_and_failure/mixed/type_and_value_with_types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: { diff --git a/test/bcdd/result/context/expectations/with_subject/success_and_failure/mixed/types_with_type_and_value_test.rb b/test/bcdd/result/context/expectations/with_source/success_and_failure/mixed/types_with_type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success_and_failure/mixed/types_with_type_and_value_test.rb rename to test/bcdd/result/context/expectations/with_source/success_and_failure/mixed/types_with_type_and_value_test.rb index c9da6ce..fdae006 100644 --- a/test/bcdd/result/context/expectations/with_subject/success_and_failure/mixed/types_with_type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success_and_failure/mixed/types_with_type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: %i[numbers division_completed], diff --git a/test/bcdd/result/context/expectations/with_subject/success_and_failure/type_and_value_test.rb b/test/bcdd/result/context/expectations/with_source/success_and_failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success_and_failure/type_and_value_test.rb rename to test/bcdd/result/context/expectations/with_source/success_and_failure/type_and_value_test.rb index e7deb86..06391d8 100644 --- a/test/bcdd/result/context/expectations/with_subject/success_and_failure/type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success_and_failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessAndFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessAndFailureTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: { diff --git a/test/bcdd/result/context/expectations/with_subject/success_and_failure/type_test.rb b/test/bcdd/result/context/expectations/with_source/success_and_failure/type_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success_and_failure/type_test.rb rename to test/bcdd/result/context/expectations/with_source/success_and_failure/type_test.rb index 69df6f1..5450661 100644 --- a/test/bcdd/result/context/expectations/with_subject/success_and_failure/type_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success_and_failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessAndFailureTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessAndFailureTypeTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: :ok, diff --git a/test/bcdd/result/context/expectations/with_subject/success_and_failure/types_test.rb b/test/bcdd/result/context/expectations/with_source/success_and_failure/types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/with_subject/success_and_failure/types_test.rb rename to test/bcdd/result/context/expectations/with_source/success_and_failure/types_test.rb index 9bbc524..a35f63a 100644 --- a/test/bcdd/result/context/expectations/with_subject/success_and_failure/types_test.rb +++ b/test/bcdd/result/context/expectations/with_source/success_and_failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithSubjectSuccessAndFailureTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithSourceSuccessAndFailureTypesTest < Minitest::Test class Divide include BCDD::Result::Context::Expectations.mixin( success: %i[numbers division_completed], diff --git a/test/bcdd/result/context/expectations/without_subject/failure/type/invalid_type_test.rb b/test/bcdd/result/context/expectations/without_source/failure/type/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/without_subject/failure/type/invalid_type_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/type/invalid_type_test.rb index 12da9c5..883e76b 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/type/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureInvalidTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureInvalidTypeTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: :err diff --git a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value/invalid_type_test.rb b/test/bcdd/result/context/expectations/without_source/failure/type_and_value/invalid_type_test.rb similarity index 93% rename from test/bcdd/result/context/expectations/without_subject/failure/type_and_value/invalid_type_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/type_and_value/invalid_type_test.rb index 9dab0b9..111b17c 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureInvalidTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureInvalidTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: { diff --git a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value/invalid_value_test.rb b/test/bcdd/result/context/expectations/without_source/failure/type_and_value/invalid_value_test.rb similarity index 91% rename from test/bcdd/result/context/expectations/without_subject/failure/type_and_value/invalid_value_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/type_and_value/invalid_value_test.rb index 506c928..58807fc 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureTypeAndValueInvalidValueTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: { diff --git a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/context/expectations/without_source/failure/type_and_value/pattern_matching_error_test.rb similarity index 91% rename from test/bcdd/result/context/expectations/without_subject/failure/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/type_and_value/pattern_matching_error_test.rb index 0f24541..fb39bc7 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: { diff --git a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value_test.rb b/test/bcdd/result/context/expectations/without_source/failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/failure/type_and_value_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/type_and_value_test.rb index 593a80d..b69c8bc 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: { diff --git a/test/bcdd/result/context/expectations/without_subject/failure/type_test.rb b/test/bcdd/result/context/expectations/without_source/failure/type_test.rb similarity index 97% rename from test/bcdd/result/context/expectations/without_subject/failure/type_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/type_test.rb index bb9347c..dcc1e66 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureTypeTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: :err diff --git a/test/bcdd/result/context/expectations/without_subject/failure/types/invalid_type_test.rb b/test/bcdd/result/context/expectations/without_source/failure/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/without_subject/failure/types/invalid_type_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/types/invalid_type_test.rb index 61ca27f..3174ecf 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/types/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureInvalidTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureInvalidTypesTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: %i[err1 err2] diff --git a/test/bcdd/result/context/expectations/without_subject/failure/types_test.rb b/test/bcdd/result/context/expectations/without_source/failure/types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/failure/types_test.rb rename to test/bcdd/result/context/expectations/without_source/failure/types_test.rb index 4706e45..cc5b8a4 100644 --- a/test/bcdd/result/context/expectations/without_subject/failure/types_test.rb +++ b/test/bcdd/result/context/expectations/without_source/failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectFailureTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceFailureTypesTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( failure: %i[invalid_arg division_by_zero] diff --git a/test/bcdd/result/context/expectations/without_subject/success/type/invalid_type_test.rb b/test/bcdd/result/context/expectations/without_source/success/type/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/without_subject/success/type/invalid_type_test.rb rename to test/bcdd/result/context/expectations/without_source/success/type/invalid_type_test.rb index beb9b7f..0fafc74 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/type/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessInvalidTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessInvalidTypeTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: :ok diff --git a/test/bcdd/result/context/expectations/without_subject/success/type_and_value/invalid_type_test.rb b/test/bcdd/result/context/expectations/without_source/success/type_and_value/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/without_subject/success/type_and_value/invalid_type_test.rb rename to test/bcdd/result/context/expectations/without_source/success/type_and_value/invalid_type_test.rb index 7bfc283..bc5ac1f 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessTypeAndValueInvalidTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessTypeAndValueInvalidTypeTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: { diff --git a/test/bcdd/result/context/expectations/without_subject/success/type_and_value/invalid_value_test.rb b/test/bcdd/result/context/expectations/without_source/success/type_and_value/invalid_value_test.rb similarity index 90% rename from test/bcdd/result/context/expectations/without_subject/success/type_and_value/invalid_value_test.rb rename to test/bcdd/result/context/expectations/without_source/success/type_and_value/invalid_value_test.rb index d52891e..1e45b31 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessTypeAndValueInvalidValueTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: { diff --git a/test/bcdd/result/context/expectations/without_subject/success/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/context/expectations/without_source/success/type_and_value/pattern_matching_error_test.rb similarity index 89% rename from test/bcdd/result/context/expectations/without_subject/success/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/context/expectations/without_source/success/type_and_value/pattern_matching_error_test.rb index da1ff60..ad3f447 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: { diff --git a/test/bcdd/result/context/expectations/without_subject/success/type_and_value_test.rb b/test/bcdd/result/context/expectations/without_source/success/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success/type_and_value_test.rb rename to test/bcdd/result/context/expectations/without_source/success/type_and_value_test.rb index 20ddc38..851dd6a 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: { diff --git a/test/bcdd/result/context/expectations/without_subject/success/type_test.rb b/test/bcdd/result/context/expectations/without_source/success/type_test.rb similarity index 97% rename from test/bcdd/result/context/expectations/without_subject/success/type_test.rb rename to test/bcdd/result/context/expectations/without_source/success/type_test.rb index 483c9f7..64f3f7b 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessTypeTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: :ok diff --git a/test/bcdd/result/context/expectations/without_subject/success/types/invalid_type_test.rb b/test/bcdd/result/context/expectations/without_source/success/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/context/expectations/without_subject/success/types/invalid_type_test.rb rename to test/bcdd/result/context/expectations/without_source/success/types/invalid_type_test.rb index 503f629..7a7bd18 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/types/invalid_type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessInvalidTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessInvalidTypesTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: %i[ok1 ok2 ok3] diff --git a/test/bcdd/result/context/expectations/without_subject/success/types_test.rb b/test/bcdd/result/context/expectations/without_source/success/types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success/types_test.rb rename to test/bcdd/result/context/expectations/without_source/success/types_test.rb index 83948cb..2cfc064 100644 --- a/test/bcdd/result/context/expectations/without_subject/success/types_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessTypesTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: %i[numbers division_completed] diff --git a/test/bcdd/result/context/expectations/without_subject/success_and_failure/mixed/type_and_value_with_types_test.rb b/test/bcdd/result/context/expectations/without_source/success_and_failure/mixed/type_and_value_with_types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success_and_failure/mixed/type_and_value_with_types_test.rb rename to test/bcdd/result/context/expectations/without_source/success_and_failure/mixed/type_and_value_with_types_test.rb index 9a82832..291c4fe 100644 --- a/test/bcdd/result/context/expectations/without_subject/success_and_failure/mixed/type_and_value_with_types_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success_and_failure/mixed/type_and_value_with_types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: { diff --git a/test/bcdd/result/context/expectations/without_subject/success_and_failure/mixed/types_with_type_and_value_test.rb b/test/bcdd/result/context/expectations/without_source/success_and_failure/mixed/types_with_type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success_and_failure/mixed/types_with_type_and_value_test.rb rename to test/bcdd/result/context/expectations/without_source/success_and_failure/mixed/types_with_type_and_value_test.rb index c83a263..b08fdfd 100644 --- a/test/bcdd/result/context/expectations/without_subject/success_and_failure/mixed/types_with_type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success_and_failure/mixed/types_with_type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: %i[numbers division_completed], diff --git a/test/bcdd/result/context/expectations/without_subject/success_and_failure/type_and_value_test.rb b/test/bcdd/result/context/expectations/without_source/success_and_failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success_and_failure/type_and_value_test.rb rename to test/bcdd/result/context/expectations/without_source/success_and_failure/type_and_value_test.rb index adafdab..c319d46 100644 --- a/test/bcdd/result/context/expectations/without_subject/success_and_failure/type_and_value_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success_and_failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessAndFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessAndFailureTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: { diff --git a/test/bcdd/result/context/expectations/without_subject/success_and_failure/type_test.rb b/test/bcdd/result/context/expectations/without_source/success_and_failure/type_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success_and_failure/type_test.rb rename to test/bcdd/result/context/expectations/without_source/success_and_failure/type_test.rb index f476a51..2f00191 100644 --- a/test/bcdd/result/context/expectations/without_subject/success_and_failure/type_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success_and_failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessAndFailureTypeTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessAndFailureTypeTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: :ok, diff --git a/test/bcdd/result/context/expectations/without_subject/success_and_failure/types_test.rb b/test/bcdd/result/context/expectations/without_source/success_and_failure/types_test.rb similarity index 98% rename from test/bcdd/result/context/expectations/without_subject/success_and_failure/types_test.rb rename to test/bcdd/result/context/expectations/without_source/success_and_failure/types_test.rb index 76d1230..2343eca 100644 --- a/test/bcdd/result/context/expectations/without_subject/success_and_failure/types_test.rb +++ b/test/bcdd/result/context/expectations/without_source/success_and_failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::Context::ExpectationsWithoutSubjectSuccessAndFailureTypesTest < Minitest::Test +class BCDD::Result::Context::ExpectationsWithoutSourceSuccessAndFailureTypesTest < Minitest::Test class Divide Result = BCDD::Result::Context::Expectations.new( success: %i[numbers division_completed], diff --git a/test/bcdd/result/context/transitions/disabled/with_subject/flat_test.rb b/test/bcdd/result/context/transitions/disabled/with_source/flat_test.rb similarity index 97% rename from test/bcdd/result/context/transitions/disabled/with_subject/flat_test.rb rename to test/bcdd/result/context/transitions/disabled/with_source/flat_test.rb index 6ef8e3b..548980e 100644 --- a/test/bcdd/result/context/transitions/disabled/with_subject/flat_test.rb +++ b/test/bcdd/result/context/transitions/disabled/with_source/flat_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsDisabledWithSubjectInstanceFlatTest < Minitest::Test + class Context::TransitionsDisabledWithSourceInstanceFlatTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/context/transitions/disabled/with_subject/nested_test.rb b/test/bcdd/result/context/transitions/disabled/with_source/nested_test.rb similarity index 97% rename from test/bcdd/result/context/transitions/disabled/with_subject/nested_test.rb rename to test/bcdd/result/context/transitions/disabled/with_source/nested_test.rb index 905b6a3..2ed2199 100644 --- a/test/bcdd/result/context/transitions/disabled/with_subject/nested_test.rb +++ b/test/bcdd/result/context/transitions/disabled/with_source/nested_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsDisabledWithSubjectInstanceNestedTest < Minitest::Test + class Context::TransitionsDisabledWithSourceInstanceNestedTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/context/transitions/disabled/with_subject/recursion_test.rb b/test/bcdd/result/context/transitions/disabled/with_source/recursion_test.rb similarity index 94% rename from test/bcdd/result/context/transitions/disabled/with_subject/recursion_test.rb rename to test/bcdd/result/context/transitions/disabled/with_source/recursion_test.rb index f73c2a7..4a025f3 100644 --- a/test/bcdd/result/context/transitions/disabled/with_subject/recursion_test.rb +++ b/test/bcdd/result/context/transitions/disabled/with_source/recursion_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsDisabledWithSubjectInstanceRecursionTest < Minitest::Test + class Context::TransitionsDisabledWithSourceInstanceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/context/transitions/disabled/without_subject/flat_test.rb b/test/bcdd/result/context/transitions/disabled/without_source/flat_test.rb similarity index 96% rename from test/bcdd/result/context/transitions/disabled/without_subject/flat_test.rb rename to test/bcdd/result/context/transitions/disabled/without_source/flat_test.rb index 2172cd0..f9683b2 100644 --- a/test/bcdd/result/context/transitions/disabled/without_subject/flat_test.rb +++ b/test/bcdd/result/context/transitions/disabled/without_source/flat_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsDisabledWithoutSubjectInstanceFlatTest < Minitest::Test + class Context::TransitionsDisabledWithoutSourceInstanceFlatTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/context/transitions/disabled/without_subject/nested_test.rb b/test/bcdd/result/context/transitions/disabled/without_source/nested_test.rb similarity index 97% rename from test/bcdd/result/context/transitions/disabled/without_subject/nested_test.rb rename to test/bcdd/result/context/transitions/disabled/without_source/nested_test.rb index 6c1c142..6cc6630 100644 --- a/test/bcdd/result/context/transitions/disabled/without_subject/nested_test.rb +++ b/test/bcdd/result/context/transitions/disabled/without_source/nested_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsDisabledWithoutSubjectInstanceNestedTest < Minitest::Test + class Context::TransitionsDisabledWithoutSourceInstanceNestedTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/context/transitions/disabled/without_subject/recursion_test.rb b/test/bcdd/result/context/transitions/disabled/without_source/recursion_test.rb similarity index 94% rename from test/bcdd/result/context/transitions/disabled/without_subject/recursion_test.rb rename to test/bcdd/result/context/transitions/disabled/without_source/recursion_test.rb index e5f69e8..3edd08f 100644 --- a/test/bcdd/result/context/transitions/disabled/without_subject/recursion_test.rb +++ b/test/bcdd/result/context/transitions/disabled/without_source/recursion_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsDisabledWithoutSubjectInstanceRecursionTest < Minitest::Test + class Context::TransitionsDisabledWithoutSourceInstanceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/context/transitions/enabled/with_subject/instance/flat_test.rb b/test/bcdd/result/context/transitions/enabled/with_source/instance/flat_test.rb similarity index 96% rename from test/bcdd/result/context/transitions/enabled/with_subject/instance/flat_test.rb rename to test/bcdd/result/context/transitions/enabled/with_source/instance/flat_test.rb index e4a7b97..f6279c8 100644 --- a/test/bcdd/result/context/transitions/enabled/with_subject/instance/flat_test.rb +++ b/test/bcdd/result/context/transitions/enabled/with_source/instance/flat_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithSubjectInstanceFlatTest < Minitest::Test + class Context::TransitionsEnabledWithSourceInstanceFlatTest < Minitest::Test include BCDDResultTransitionAssertions class Division diff --git a/test/bcdd/result/context/transitions/enabled/with_subject/instance/nested_test.rb b/test/bcdd/result/context/transitions/enabled/with_source/instance/nested_test.rb similarity index 97% rename from test/bcdd/result/context/transitions/enabled/with_subject/instance/nested_test.rb rename to test/bcdd/result/context/transitions/enabled/with_source/instance/nested_test.rb index 4f7d735..7a9e410 100644 --- a/test/bcdd/result/context/transitions/enabled/with_subject/instance/nested_test.rb +++ b/test/bcdd/result/context/transitions/enabled/with_source/instance/nested_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithSubjectInstanceNestedTest < Minitest::Test + class Context::TransitionsEnabledWithSourceInstanceNestedTest < Minitest::Test include BCDDResultTransitionAssertions class Division diff --git a/test/bcdd/result/context/transitions/enabled/with_subject/instance/recursion_test.rb b/test/bcdd/result/context/transitions/enabled/with_source/instance/recursion_test.rb similarity index 94% rename from test/bcdd/result/context/transitions/enabled/with_subject/instance/recursion_test.rb rename to test/bcdd/result/context/transitions/enabled/with_source/instance/recursion_test.rb index a379dcf..06224fa 100644 --- a/test/bcdd/result/context/transitions/enabled/with_subject/instance/recursion_test.rb +++ b/test/bcdd/result/context/transitions/enabled/with_source/instance/recursion_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithSubjectInstanceRecursionTest < Minitest::Test + class Context::TransitionsEnabledWithSourceInstanceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions class Fibonacci diff --git a/test/bcdd/result/context/transitions/enabled/with_subject/singleton/flat_test.rb b/test/bcdd/result/context/transitions/enabled/with_source/singleton/flat_test.rb similarity index 96% rename from test/bcdd/result/context/transitions/enabled/with_subject/singleton/flat_test.rb rename to test/bcdd/result/context/transitions/enabled/with_source/singleton/flat_test.rb index 7d39f34..804f7b9 100644 --- a/test/bcdd/result/context/transitions/enabled/with_subject/singleton/flat_test.rb +++ b/test/bcdd/result/context/transitions/enabled/with_source/singleton/flat_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithSubjectSingletonFlatTest < Minitest::Test + class Context::TransitionsEnabledWithSourceSingletonFlatTest < Minitest::Test include BCDDResultTransitionAssertions module Division diff --git a/test/bcdd/result/context/transitions/enabled/with_subject/singleton/nested_test.rb b/test/bcdd/result/context/transitions/enabled/with_source/singleton/nested_test.rb similarity index 95% rename from test/bcdd/result/context/transitions/enabled/with_subject/singleton/nested_test.rb rename to test/bcdd/result/context/transitions/enabled/with_source/singleton/nested_test.rb index bbb9331..988fd3f 100644 --- a/test/bcdd/result/context/transitions/enabled/with_subject/singleton/nested_test.rb +++ b/test/bcdd/result/context/transitions/enabled/with_source/singleton/nested_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithSubjectSingletonNestedTest < Minitest::Test + class Context::TransitionsEnabledWithSourceSingletonNestedTest < Minitest::Test include BCDDResultTransitionAssertions module Division @@ -195,7 +195,7 @@ def divide_by_two(num) parent: root, current: { id: Integer, name: nil, desc: nil }, result: { kind: :success, type: :continued, value: {} }, - and_then: { type: :method, arg: { useless_arg: true }, subject: Division, method_name: :validate_nonzero } + and_then: { type: :method, arg: { useless_arg: true }, source: Division, method_name: :validate_nonzero } }.then { |spec| assert_transition_record(result, 2, spec) } { @@ -203,7 +203,7 @@ def divide_by_two(num) parent: root, current: { id: Integer, name: nil, desc: nil }, result: { kind: :success, type: :division_completed, value: { number: 10 } }, - and_then: { type: :method, arg: {}, subject: Division, method_name: :divide } + and_then: { type: :method, arg: {}, source: Division, method_name: :divide } }.then { |spec| assert_transition_record(result, 3, spec) } # 3rd division transitions @@ -225,7 +225,7 @@ def divide_by_two(num) parent: root, current: { id: Integer, name: nil, desc: nil }, result: { kind: :success, type: :continued, value: {} }, - and_then: { type: :method, arg: { useless_arg: true }, subject: Division, method_name: :validate_nonzero } + and_then: { type: :method, arg: { useless_arg: true }, source: Division, method_name: :validate_nonzero } }.then { |spec| assert_transition_record(result, 5, spec) } { @@ -233,7 +233,7 @@ def divide_by_two(num) parent: root, current: { id: Integer, name: nil, desc: nil }, result: { kind: :success, type: :division_completed, value: { number: 0 } }, - and_then: { type: :method, arg: {}, subject: Division, method_name: :divide } + and_then: { type: :method, arg: {}, source: Division, method_name: :divide } }.then { |spec| assert_transition_record(result, 6, spec) } # Final result transition diff --git a/test/bcdd/result/context/transitions/enabled/with_subject/singleton/recursion_test.rb b/test/bcdd/result/context/transitions/enabled/with_source/singleton/recursion_test.rb similarity index 93% rename from test/bcdd/result/context/transitions/enabled/with_subject/singleton/recursion_test.rb rename to test/bcdd/result/context/transitions/enabled/with_source/singleton/recursion_test.rb index 4143ef5..800892a 100644 --- a/test/bcdd/result/context/transitions/enabled/with_subject/singleton/recursion_test.rb +++ b/test/bcdd/result/context/transitions/enabled/with_source/singleton/recursion_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithSubjectSingletonRecursionTest < Minitest::Test + class Context::TransitionsEnabledWithSourceSingletonRecursionTest < Minitest::Test include BCDDResultTransitionAssertions module Fibonacci diff --git a/test/bcdd/result/context/transitions/enabled/without_subject/instance/flat_test.rb b/test/bcdd/result/context/transitions/enabled/without_source/instance/flat_test.rb similarity index 96% rename from test/bcdd/result/context/transitions/enabled/without_subject/instance/flat_test.rb rename to test/bcdd/result/context/transitions/enabled/without_source/instance/flat_test.rb index 6f352b5..de1abfa 100644 --- a/test/bcdd/result/context/transitions/enabled/without_subject/instance/flat_test.rb +++ b/test/bcdd/result/context/transitions/enabled/without_source/instance/flat_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithoutSubjectInstanceFlatTest < Minitest::Test + class Context::TransitionsEnabledWithoutSourceInstanceFlatTest < Minitest::Test include BCDDResultTransitionAssertions class Division diff --git a/test/bcdd/result/context/transitions/enabled/without_subject/instance/nested_test.rb b/test/bcdd/result/context/transitions/enabled/without_source/instance/nested_test.rb similarity index 97% rename from test/bcdd/result/context/transitions/enabled/without_subject/instance/nested_test.rb rename to test/bcdd/result/context/transitions/enabled/without_source/instance/nested_test.rb index 07eeb47..0583812 100644 --- a/test/bcdd/result/context/transitions/enabled/without_subject/instance/nested_test.rb +++ b/test/bcdd/result/context/transitions/enabled/without_source/instance/nested_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithoutSubjectInstanceNestedTest < Minitest::Test + class Context::TransitionsEnabledWithoutSourceInstanceNestedTest < Minitest::Test include BCDDResultTransitionAssertions class Division diff --git a/test/bcdd/result/context/transitions/enabled/without_subject/instance/recursion_test.rb b/test/bcdd/result/context/transitions/enabled/without_source/instance/recursion_test.rb similarity index 93% rename from test/bcdd/result/context/transitions/enabled/without_subject/instance/recursion_test.rb rename to test/bcdd/result/context/transitions/enabled/without_source/instance/recursion_test.rb index 88f763f..623c5bc 100644 --- a/test/bcdd/result/context/transitions/enabled/without_subject/instance/recursion_test.rb +++ b/test/bcdd/result/context/transitions/enabled/without_source/instance/recursion_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithoutSubjectInstanceRecursionTest < Minitest::Test + class Context::TransitionsEnabledWithoutSourceInstanceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions class Fibonacci diff --git a/test/bcdd/result/context/transitions/enabled/without_subject/singleton/flat_test.rb b/test/bcdd/result/context/transitions/enabled/without_source/singleton/flat_test.rb similarity index 96% rename from test/bcdd/result/context/transitions/enabled/without_subject/singleton/flat_test.rb rename to test/bcdd/result/context/transitions/enabled/without_source/singleton/flat_test.rb index 54a36a9..5909071 100644 --- a/test/bcdd/result/context/transitions/enabled/without_subject/singleton/flat_test.rb +++ b/test/bcdd/result/context/transitions/enabled/without_source/singleton/flat_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithoutSubjectSingletonFlatTest < Minitest::Test + class Context::TransitionsEnabledWithoutSourceSingletonFlatTest < Minitest::Test include BCDDResultTransitionAssertions module Division diff --git a/test/bcdd/result/context/transitions/enabled/without_subject/singleton/nested_test.rb b/test/bcdd/result/context/transitions/enabled/without_source/singleton/nested_test.rb similarity index 97% rename from test/bcdd/result/context/transitions/enabled/without_subject/singleton/nested_test.rb rename to test/bcdd/result/context/transitions/enabled/without_source/singleton/nested_test.rb index 699c058..20b975b 100644 --- a/test/bcdd/result/context/transitions/enabled/without_subject/singleton/nested_test.rb +++ b/test/bcdd/result/context/transitions/enabled/without_source/singleton/nested_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithoutSubjectSingletonNestedTest < Minitest::Test + class Context::TransitionsEnabledWithoutSourceSingletonNestedTest < Minitest::Test include BCDDResultTransitionAssertions module Division diff --git a/test/bcdd/result/context/transitions/enabled/without_subject/singleton/recursion_test.rb b/test/bcdd/result/context/transitions/enabled/without_source/singleton/recursion_test.rb similarity index 93% rename from test/bcdd/result/context/transitions/enabled/without_subject/singleton/recursion_test.rb rename to test/bcdd/result/context/transitions/enabled/without_source/singleton/recursion_test.rb index 87451a3..108bcc0 100644 --- a/test/bcdd/result/context/transitions/enabled/without_subject/singleton/recursion_test.rb +++ b/test/bcdd/result/context/transitions/enabled/without_source/singleton/recursion_test.rb @@ -3,7 +3,7 @@ require 'test_helper' class BCDD::Result - class Context::TransitionsEnabledWithoutSubjectSingletonRecursionTest < Minitest::Test + class Context::TransitionsEnabledWithoutSourceSingletonRecursionTest < Minitest::Test include BCDDResultTransitionAssertions module Fibonacci diff --git a/test/bcdd/result/error_test.rb b/test/bcdd/result/error_test.rb index 13fd051..bc10b12 100644 --- a/test/bcdd/result/error_test.rb +++ b/test/bcdd/result/error_test.rb @@ -42,36 +42,36 @@ class BCDD::Result::ErrorTest < Minitest::Test ) end - test '::Error::InvalidResultSubject.build' do - assert BCDD::Result::Error::InvalidResultSubject < BCDD::Result::Error + test '::Error::InvalidResultSource.build' do + assert BCDD::Result::Error::InvalidResultSource < BCDD::Result::Error - given_result = BCDD::Result::Success.new(type: :number, value: 3, subject: 1) + given_result = BCDD::Result::Success.new(type: :number, value: 3, source: 1) - error_input = { given_result: given_result, expected_subject: 2 } + error_input = { given_result: given_result, expected_source: 2 } assert_equal( - "You cannot call #and_then and return a result that does not belong to the subject!\n" \ - "Expected subject: 2\n" \ - "Given subject: 1\n" \ + "You cannot call #and_then and return a result that does not belong to the same source!\n" \ + "Expected source: 2\n" \ + "Given source: 1\n" \ 'Given result: #', - BCDD::Result::Error::InvalidResultSubject.build(**error_input).message + BCDD::Result::Error::InvalidResultSource.build(**error_input).message ) end - test '::Error::InvalidSubjectMethodArity.build' do - assert BCDD::Result::Error::InvalidSubjectMethodArity < BCDD::Result::Error + test '::Error::InvalidSourceMethodArity.build' do + assert BCDD::Result::Error::InvalidSourceMethodArity < BCDD::Result::Error - subject = Object.new + source = Object.new - def subject.do_something(_arg1, _arg2, _arg3); end + def source.do_something(_arg1, _arg2, _arg3); end - method = subject.method(:do_something) + method = source.method(:do_something) - error_input = { subject: subject, method: method, max_arity: 2 } + error_input = { source: source, method: method, max_arity: 2 } assert_equal( 'Object#do_something has unsupported arity (3). Expected 0..2', - BCDD::Result::Error::InvalidSubjectMethodArity.build(**error_input).message + BCDD::Result::Error::InvalidSourceMethodArity.build(**error_input).message ) end end diff --git a/test/bcdd/result/expectations/with_subject/failure/type/invalid_type_test.rb b/test/bcdd/result/expectations/with_source/failure/type/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/with_subject/failure/type/invalid_type_test.rb rename to test/bcdd/result/expectations/with_source/failure/type/invalid_type_test.rb index 08792cd..46ea257 100644 --- a/test/bcdd/result/expectations/with_subject/failure/type/invalid_type_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureInvalidTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureInvalidTypeTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: :err diff --git a/test/bcdd/result/expectations/with_subject/failure/type_and_value/invalid_type_test.rb b/test/bcdd/result/expectations/with_source/failure/type_and_value/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/with_subject/failure/type_and_value/invalid_type_test.rb rename to test/bcdd/result/expectations/with_source/failure/type_and_value/invalid_type_test.rb index 7a9aa54..c157329 100644 --- a/test/bcdd/result/expectations/with_subject/failure/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureInvalidTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureInvalidTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: { diff --git a/test/bcdd/result/expectations/with_subject/failure/type_and_value/invalid_value_test.rb b/test/bcdd/result/expectations/with_source/failure/type_and_value/invalid_value_test.rb similarity index 89% rename from test/bcdd/result/expectations/with_subject/failure/type_and_value/invalid_value_test.rb rename to test/bcdd/result/expectations/with_source/failure/type_and_value/invalid_value_test.rb index 4e4a5c9..bd29aa8 100644 --- a/test/bcdd/result/expectations/with_subject/failure/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureTypeAndValueInvalidValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: { diff --git a/test/bcdd/result/expectations/with_subject/failure/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/expectations/with_source/failure/type_and_value/pattern_matching_error_test.rb similarity index 90% rename from test/bcdd/result/expectations/with_subject/failure/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/expectations/with_source/failure/type_and_value/pattern_matching_error_test.rb index a2f843e..7c0f7da 100644 --- a/test/bcdd/result/expectations/with_subject/failure/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: { diff --git a/test/bcdd/result/expectations/with_subject/failure/type_and_value_test.rb b/test/bcdd/result/expectations/with_source/failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/failure/type_and_value_test.rb rename to test/bcdd/result/expectations/with_source/failure/type_and_value_test.rb index 34b8140..54e5bba 100644 --- a/test/bcdd/result/expectations/with_subject/failure/type_and_value_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: { diff --git a/test/bcdd/result/expectations/with_subject/failure/type_test.rb b/test/bcdd/result/expectations/with_source/failure/type_test.rb similarity index 97% rename from test/bcdd/result/expectations/with_subject/failure/type_test.rb rename to test/bcdd/result/expectations/with_source/failure/type_test.rb index ece898a..58b4bea 100644 --- a/test/bcdd/result/expectations/with_subject/failure/type_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureTypeTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: :err diff --git a/test/bcdd/result/expectations/with_subject/failure/types/invalid_type_test.rb b/test/bcdd/result/expectations/with_source/failure/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/with_subject/failure/types/invalid_type_test.rb rename to test/bcdd/result/expectations/with_source/failure/types/invalid_type_test.rb index 3fa1489..c47d94d 100644 --- a/test/bcdd/result/expectations/with_subject/failure/types/invalid_type_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureInvalidTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureInvalidTypesTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: %i[err1 err2] diff --git a/test/bcdd/result/expectations/with_subject/failure/types_test.rb b/test/bcdd/result/expectations/with_source/failure/types_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/failure/types_test.rb rename to test/bcdd/result/expectations/with_source/failure/types_test.rb index 2ffeb97..4d69288 100644 --- a/test/bcdd/result/expectations/with_subject/failure/types_test.rb +++ b/test/bcdd/result/expectations/with_source/failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectFailureTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceFailureTypesTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( failure: %i[invalid_arg division_by_zero] diff --git a/test/bcdd/result/expectations/with_subject/success/type/invalid_type_test.rb b/test/bcdd/result/expectations/with_source/success/type/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/expectations/with_subject/success/type/invalid_type_test.rb rename to test/bcdd/result/expectations/with_source/success/type/invalid_type_test.rb index fc24269..a3033f2 100644 --- a/test/bcdd/result/expectations/with_subject/success/type/invalid_type_test.rb +++ b/test/bcdd/result/expectations/with_source/success/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessInvalidTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessInvalidTypeTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: :ok diff --git a/test/bcdd/result/expectations/with_subject/success/type_and_value/invalid_type_test.rb b/test/bcdd/result/expectations/with_source/success/type_and_value/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/expectations/with_subject/success/type_and_value/invalid_type_test.rb rename to test/bcdd/result/expectations/with_source/success/type_and_value/invalid_type_test.rb index 0a5cabd..789d013 100644 --- a/test/bcdd/result/expectations/with_subject/success/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/expectations/with_source/success/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessTypeAndValueInvalidTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessTypeAndValueInvalidTypeTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: { diff --git a/test/bcdd/result/expectations/with_subject/success/type_and_value/invalid_value_test.rb b/test/bcdd/result/expectations/with_source/success/type_and_value/invalid_value_test.rb similarity index 89% rename from test/bcdd/result/expectations/with_subject/success/type_and_value/invalid_value_test.rb rename to test/bcdd/result/expectations/with_source/success/type_and_value/invalid_value_test.rb index c8728a4..a876de1 100644 --- a/test/bcdd/result/expectations/with_subject/success/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/expectations/with_source/success/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessTypeAndValueInvalidValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: { diff --git a/test/bcdd/result/expectations/with_subject/success/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/expectations/with_source/success/type_and_value/pattern_matching_error_test.rb similarity index 90% rename from test/bcdd/result/expectations/with_subject/success/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/expectations/with_source/success/type_and_value/pattern_matching_error_test.rb index b85d576..b56cc16 100644 --- a/test/bcdd/result/expectations/with_subject/success/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/expectations/with_source/success/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: { diff --git a/test/bcdd/result/expectations/with_subject/success/type_and_value_test.rb b/test/bcdd/result/expectations/with_source/success/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success/type_and_value_test.rb rename to test/bcdd/result/expectations/with_source/success/type_and_value_test.rb index 9eab73e..54a4c2b 100644 --- a/test/bcdd/result/expectations/with_subject/success/type_and_value_test.rb +++ b/test/bcdd/result/expectations/with_source/success/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: { diff --git a/test/bcdd/result/expectations/with_subject/success/type_test.rb b/test/bcdd/result/expectations/with_source/success/type_test.rb similarity index 97% rename from test/bcdd/result/expectations/with_subject/success/type_test.rb rename to test/bcdd/result/expectations/with_source/success/type_test.rb index 6af0ca7..b285a8d 100644 --- a/test/bcdd/result/expectations/with_subject/success/type_test.rb +++ b/test/bcdd/result/expectations/with_source/success/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessTypeTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: :ok diff --git a/test/bcdd/result/expectations/with_subject/success/types/invalid_type_test.rb b/test/bcdd/result/expectations/with_source/success/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/with_subject/success/types/invalid_type_test.rb rename to test/bcdd/result/expectations/with_source/success/types/invalid_type_test.rb index 9c50fc9..85f59f1 100644 --- a/test/bcdd/result/expectations/with_subject/success/types/invalid_type_test.rb +++ b/test/bcdd/result/expectations/with_source/success/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessInvalidTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessInvalidTypesTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: %i[ok1 ok2 ok3] diff --git a/test/bcdd/result/expectations/with_subject/success/types_test.rb b/test/bcdd/result/expectations/with_source/success/types_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success/types_test.rb rename to test/bcdd/result/expectations/with_source/success/types_test.rb index 62c0eba..7c0486b 100644 --- a/test/bcdd/result/expectations/with_subject/success/types_test.rb +++ b/test/bcdd/result/expectations/with_source/success/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessTypesTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: %i[numbers division_completed] diff --git a/test/bcdd/result/expectations/with_subject/success_and_failure/mixed/type_and_value_with_types_test.rb b/test/bcdd/result/expectations/with_source/success_and_failure/mixed/type_and_value_with_types_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success_and_failure/mixed/type_and_value_with_types_test.rb rename to test/bcdd/result/expectations/with_source/success_and_failure/mixed/type_and_value_with_types_test.rb index 12047e6..9952c56 100644 --- a/test/bcdd/result/expectations/with_subject/success_and_failure/mixed/type_and_value_with_types_test.rb +++ b/test/bcdd/result/expectations/with_source/success_and_failure/mixed/type_and_value_with_types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: { diff --git a/test/bcdd/result/expectations/with_subject/success_and_failure/mixed/types_with_type_and_value_test.rb b/test/bcdd/result/expectations/with_source/success_and_failure/mixed/types_with_type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success_and_failure/mixed/types_with_type_and_value_test.rb rename to test/bcdd/result/expectations/with_source/success_and_failure/mixed/types_with_type_and_value_test.rb index 3b12d4d..01a0271 100644 --- a/test/bcdd/result/expectations/with_subject/success_and_failure/mixed/types_with_type_and_value_test.rb +++ b/test/bcdd/result/expectations/with_source/success_and_failure/mixed/types_with_type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: %i[numbers division_completed], diff --git a/test/bcdd/result/expectations/with_subject/success_and_failure/type_and_value_test.rb b/test/bcdd/result/expectations/with_source/success_and_failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success_and_failure/type_and_value_test.rb rename to test/bcdd/result/expectations/with_source/success_and_failure/type_and_value_test.rb index 2e6f3ea..6b0de85 100644 --- a/test/bcdd/result/expectations/with_subject/success_and_failure/type_and_value_test.rb +++ b/test/bcdd/result/expectations/with_source/success_and_failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessAndFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessAndFailureTypeAndValueTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: { diff --git a/test/bcdd/result/expectations/with_subject/success_and_failure/type_test.rb b/test/bcdd/result/expectations/with_source/success_and_failure/type_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success_and_failure/type_test.rb rename to test/bcdd/result/expectations/with_source/success_and_failure/type_test.rb index 82d872e..b9af583 100644 --- a/test/bcdd/result/expectations/with_subject/success_and_failure/type_test.rb +++ b/test/bcdd/result/expectations/with_source/success_and_failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessAndFailureTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessAndFailureTypeTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: :ok, diff --git a/test/bcdd/result/expectations/with_subject/success_and_failure/types_test.rb b/test/bcdd/result/expectations/with_source/success_and_failure/types_test.rb similarity index 98% rename from test/bcdd/result/expectations/with_subject/success_and_failure/types_test.rb rename to test/bcdd/result/expectations/with_source/success_and_failure/types_test.rb index b9128fb..13f47af 100644 --- a/test/bcdd/result/expectations/with_subject/success_and_failure/types_test.rb +++ b/test/bcdd/result/expectations/with_source/success_and_failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithSubjectSuccessAndFailureTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithSourceSuccessAndFailureTypesTest < Minitest::Test class Divide include BCDD::Result::Expectations.mixin( success: %i[numbers division_completed], diff --git a/test/bcdd/result/expectations/without_subject/failure/type/invalid_type_test.rb b/test/bcdd/result/expectations/without_source/failure/type/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/without_subject/failure/type/invalid_type_test.rb rename to test/bcdd/result/expectations/without_source/failure/type/invalid_type_test.rb index 22c072e..f07a6c8 100644 --- a/test/bcdd/result/expectations/without_subject/failure/type/invalid_type_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureInvalidTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureInvalidTypeTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: :err diff --git a/test/bcdd/result/expectations/without_subject/failure/type_and_value/invalid_type_test.rb b/test/bcdd/result/expectations/without_source/failure/type_and_value/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/without_subject/failure/type_and_value/invalid_type_test.rb rename to test/bcdd/result/expectations/without_source/failure/type_and_value/invalid_type_test.rb index d83c85b..1af03c6 100644 --- a/test/bcdd/result/expectations/without_subject/failure/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureInvalidTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureInvalidTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: { diff --git a/test/bcdd/result/expectations/without_subject/failure/type_and_value/invalid_value_test.rb b/test/bcdd/result/expectations/without_source/failure/type_and_value/invalid_value_test.rb similarity index 89% rename from test/bcdd/result/expectations/without_subject/failure/type_and_value/invalid_value_test.rb rename to test/bcdd/result/expectations/without_source/failure/type_and_value/invalid_value_test.rb index 7e80f13..9d85348 100644 --- a/test/bcdd/result/expectations/without_subject/failure/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureTypeAndValueInvalidValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: { diff --git a/test/bcdd/result/expectations/without_subject/failure/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/expectations/without_source/failure/type_and_value/pattern_matching_error_test.rb similarity index 90% rename from test/bcdd/result/expectations/without_subject/failure/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/expectations/without_source/failure/type_and_value/pattern_matching_error_test.rb index 55feb1f..7ab52d0 100644 --- a/test/bcdd/result/expectations/without_subject/failure/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: { diff --git a/test/bcdd/result/expectations/without_subject/failure/type_and_value_test.rb b/test/bcdd/result/expectations/without_source/failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/failure/type_and_value_test.rb rename to test/bcdd/result/expectations/without_source/failure/type_and_value_test.rb index ea9269c..1a8542a 100644 --- a/test/bcdd/result/expectations/without_subject/failure/type_and_value_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: { diff --git a/test/bcdd/result/expectations/without_subject/failure/type_test.rb b/test/bcdd/result/expectations/without_source/failure/type_test.rb similarity index 97% rename from test/bcdd/result/expectations/without_subject/failure/type_test.rb rename to test/bcdd/result/expectations/without_source/failure/type_test.rb index 0542543..3d5d45f 100644 --- a/test/bcdd/result/expectations/without_subject/failure/type_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureTypeTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: :err diff --git a/test/bcdd/result/expectations/without_subject/failure/types/invalid_type_test.rb b/test/bcdd/result/expectations/without_source/failure/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/without_subject/failure/types/invalid_type_test.rb rename to test/bcdd/result/expectations/without_source/failure/types/invalid_type_test.rb index 364b776..db27a73 100644 --- a/test/bcdd/result/expectations/without_subject/failure/types/invalid_type_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureInvalidTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureInvalidTypesTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: %i[err1 err2] diff --git a/test/bcdd/result/expectations/without_subject/failure/types_test.rb b/test/bcdd/result/expectations/without_source/failure/types_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/failure/types_test.rb rename to test/bcdd/result/expectations/without_source/failure/types_test.rb index 44a92d7..676a2e8 100644 --- a/test/bcdd/result/expectations/without_subject/failure/types_test.rb +++ b/test/bcdd/result/expectations/without_source/failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectFailureTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceFailureTypesTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( failure: %i[invalid_arg division_by_zero] diff --git a/test/bcdd/result/expectations/without_subject/success/type/invalid_type_test.rb b/test/bcdd/result/expectations/without_source/success/type/invalid_type_test.rb similarity index 90% rename from test/bcdd/result/expectations/without_subject/success/type/invalid_type_test.rb rename to test/bcdd/result/expectations/without_source/success/type/invalid_type_test.rb index 8914771..641ab70 100644 --- a/test/bcdd/result/expectations/without_subject/success/type/invalid_type_test.rb +++ b/test/bcdd/result/expectations/without_source/success/type/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessInvalidTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessInvalidTypeTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: :ok diff --git a/test/bcdd/result/expectations/without_subject/success/type_and_value/invalid_type_test.rb b/test/bcdd/result/expectations/without_source/success/type_and_value/invalid_type_test.rb similarity index 89% rename from test/bcdd/result/expectations/without_subject/success/type_and_value/invalid_type_test.rb rename to test/bcdd/result/expectations/without_source/success/type_and_value/invalid_type_test.rb index 5162ddb..3dfe1e3 100644 --- a/test/bcdd/result/expectations/without_subject/success/type_and_value/invalid_type_test.rb +++ b/test/bcdd/result/expectations/without_source/success/type_and_value/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessTypeAndValueInvalidTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessTypeAndValueInvalidTypeTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: { diff --git a/test/bcdd/result/expectations/without_subject/success/type_and_value/invalid_value_test.rb b/test/bcdd/result/expectations/without_source/success/type_and_value/invalid_value_test.rb similarity index 89% rename from test/bcdd/result/expectations/without_subject/success/type_and_value/invalid_value_test.rb rename to test/bcdd/result/expectations/without_source/success/type_and_value/invalid_value_test.rb index e820d11..b72e990 100644 --- a/test/bcdd/result/expectations/without_subject/success/type_and_value/invalid_value_test.rb +++ b/test/bcdd/result/expectations/without_source/success/type_and_value/invalid_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessTypeAndValueInvalidValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessTypeAndValueInvalidValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: { diff --git a/test/bcdd/result/expectations/without_subject/success/type_and_value/pattern_matching_error_test.rb b/test/bcdd/result/expectations/without_source/success/type_and_value/pattern_matching_error_test.rb similarity index 90% rename from test/bcdd/result/expectations/without_subject/success/type_and_value/pattern_matching_error_test.rb rename to test/bcdd/result/expectations/without_source/success/type_and_value/pattern_matching_error_test.rb index cd85ffb..ebd201b 100644 --- a/test/bcdd/result/expectations/without_subject/success/type_and_value/pattern_matching_error_test.rb +++ b/test/bcdd/result/expectations/without_source/success/type_and_value/pattern_matching_error_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessTypeAndValuePatterMatchingErrorTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: { diff --git a/test/bcdd/result/expectations/without_subject/success/type_and_value_test.rb b/test/bcdd/result/expectations/without_source/success/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success/type_and_value_test.rb rename to test/bcdd/result/expectations/without_source/success/type_and_value_test.rb index 17deb26..c79772b 100644 --- a/test/bcdd/result/expectations/without_subject/success/type_and_value_test.rb +++ b/test/bcdd/result/expectations/without_source/success/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: { diff --git a/test/bcdd/result/expectations/without_subject/success/type_test.rb b/test/bcdd/result/expectations/without_source/success/type_test.rb similarity index 97% rename from test/bcdd/result/expectations/without_subject/success/type_test.rb rename to test/bcdd/result/expectations/without_source/success/type_test.rb index 2988074..740c0cd 100644 --- a/test/bcdd/result/expectations/without_subject/success/type_test.rb +++ b/test/bcdd/result/expectations/without_source/success/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessTypeTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: :ok diff --git a/test/bcdd/result/expectations/without_subject/success/types/invalid_type_test.rb b/test/bcdd/result/expectations/without_source/success/types/invalid_type_test.rb similarity index 92% rename from test/bcdd/result/expectations/without_subject/success/types/invalid_type_test.rb rename to test/bcdd/result/expectations/without_source/success/types/invalid_type_test.rb index 443cdff..4e6083a 100644 --- a/test/bcdd/result/expectations/without_subject/success/types/invalid_type_test.rb +++ b/test/bcdd/result/expectations/without_source/success/types/invalid_type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessInvalidTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessInvalidTypesTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: %i[ok1 ok2 ok3] diff --git a/test/bcdd/result/expectations/without_subject/success/types_test.rb b/test/bcdd/result/expectations/without_source/success/types_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success/types_test.rb rename to test/bcdd/result/expectations/without_source/success/types_test.rb index ee1d723..f4b7270 100644 --- a/test/bcdd/result/expectations/without_subject/success/types_test.rb +++ b/test/bcdd/result/expectations/without_source/success/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessTypesTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: %i[numbers division_completed] diff --git a/test/bcdd/result/expectations/without_subject/success_and_failure/mixed/type_and_value_with_types_test.rb b/test/bcdd/result/expectations/without_source/success_and_failure/mixed/type_and_value_with_types_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success_and_failure/mixed/type_and_value_with_types_test.rb rename to test/bcdd/result/expectations/without_source/success_and_failure/mixed/type_and_value_with_types_test.rb index 92ea217..96a64b0 100644 --- a/test/bcdd/result/expectations/without_subject/success_and_failure/mixed/type_and_value_with_types_test.rb +++ b/test/bcdd/result/expectations/without_source/success_and_failure/mixed/type_and_value_with_types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessAndFailureTypeAndValueWithTypesTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: { diff --git a/test/bcdd/result/expectations/without_subject/success_and_failure/mixed/types_with_type_and_value_test.rb b/test/bcdd/result/expectations/without_source/success_and_failure/mixed/types_with_type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success_and_failure/mixed/types_with_type_and_value_test.rb rename to test/bcdd/result/expectations/without_source/success_and_failure/mixed/types_with_type_and_value_test.rb index 6d0526e..da9fb4d 100644 --- a/test/bcdd/result/expectations/without_subject/success_and_failure/mixed/types_with_type_and_value_test.rb +++ b/test/bcdd/result/expectations/without_source/success_and_failure/mixed/types_with_type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessAndFailureTypesWithTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: %i[numbers division_completed], diff --git a/test/bcdd/result/expectations/without_subject/success_and_failure/type_and_value_test.rb b/test/bcdd/result/expectations/without_source/success_and_failure/type_and_value_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success_and_failure/type_and_value_test.rb rename to test/bcdd/result/expectations/without_source/success_and_failure/type_and_value_test.rb index 94b9ab6..3c99d45 100644 --- a/test/bcdd/result/expectations/without_subject/success_and_failure/type_and_value_test.rb +++ b/test/bcdd/result/expectations/without_source/success_and_failure/type_and_value_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessAndFailureTypeAndValueTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessAndFailureTypeAndValueTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: { diff --git a/test/bcdd/result/expectations/without_subject/success_and_failure/type_test.rb b/test/bcdd/result/expectations/without_source/success_and_failure/type_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success_and_failure/type_test.rb rename to test/bcdd/result/expectations/without_source/success_and_failure/type_test.rb index 4f96d2a..9305bb5 100644 --- a/test/bcdd/result/expectations/without_subject/success_and_failure/type_test.rb +++ b/test/bcdd/result/expectations/without_source/success_and_failure/type_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessAndFailureTypeTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessAndFailureTypeTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: :ok, diff --git a/test/bcdd/result/expectations/without_subject/success_and_failure/types_test.rb b/test/bcdd/result/expectations/without_source/success_and_failure/types_test.rb similarity index 98% rename from test/bcdd/result/expectations/without_subject/success_and_failure/types_test.rb rename to test/bcdd/result/expectations/without_source/success_and_failure/types_test.rb index 0866a44..d4a0f7e 100644 --- a/test/bcdd/result/expectations/without_subject/success_and_failure/types_test.rb +++ b/test/bcdd/result/expectations/without_source/success_and_failure/types_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::ExpectationsWithoutSubjectSuccessAndFailureTypesTest < Minitest::Test +class BCDD::Result::ExpectationsWithoutSourceSuccessAndFailureTypesTest < Minitest::Test class Divide Result = BCDD::Result::Expectations.new( success: %i[numbers division_completed], diff --git a/test/bcdd/result/transitions/disabled/with_subject/flat_test.rb b/test/bcdd/result/transitions/disabled/with_source/flat_test.rb similarity index 96% rename from test/bcdd/result/transitions/disabled/with_subject/flat_test.rb rename to test/bcdd/result/transitions/disabled/with_source/flat_test.rb index 4877e4c..8d14e3c 100644 --- a/test/bcdd/result/transitions/disabled/with_subject/flat_test.rb +++ b/test/bcdd/result/transitions/disabled/with_source/flat_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsDisabledWithSubjectFlatTest < Minitest::Test +class BCDD::Result::TransitionsDisabledWithSourceFlatTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/transitions/disabled/with_subject/nested_test.rb b/test/bcdd/result/transitions/disabled/with_source/nested_test.rb similarity index 97% rename from test/bcdd/result/transitions/disabled/with_subject/nested_test.rb rename to test/bcdd/result/transitions/disabled/with_source/nested_test.rb index 26dea9e..d8e7d04 100644 --- a/test/bcdd/result/transitions/disabled/with_subject/nested_test.rb +++ b/test/bcdd/result/transitions/disabled/with_source/nested_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsDisabledWithSubjectNestedTest < Minitest::Test +class BCDD::Result::TransitionsDisabledWithSourceNestedTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/transitions/disabled/with_subject/recursion_test.rb b/test/bcdd/result/transitions/disabled/with_source/recursion_test.rb similarity index 94% rename from test/bcdd/result/transitions/disabled/with_subject/recursion_test.rb rename to test/bcdd/result/transitions/disabled/with_source/recursion_test.rb index c470876..6b7eaea 100644 --- a/test/bcdd/result/transitions/disabled/with_subject/recursion_test.rb +++ b/test/bcdd/result/transitions/disabled/with_source/recursion_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsDisabledWithSubjectRecursionTest < Minitest::Test +class BCDD::Result::TransitionsDisabledWithSourceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/transitions/disabled/without_subject/flat_test.rb b/test/bcdd/result/transitions/disabled/without_source/flat_test.rb similarity index 96% rename from test/bcdd/result/transitions/disabled/without_subject/flat_test.rb rename to test/bcdd/result/transitions/disabled/without_source/flat_test.rb index ccadd6b..d53d66d 100644 --- a/test/bcdd/result/transitions/disabled/without_subject/flat_test.rb +++ b/test/bcdd/result/transitions/disabled/without_source/flat_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsDisabledWithoutSubjectFlatTest < Minitest::Test +class BCDD::Result::TransitionsDisabledWithoutSourceFlatTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/transitions/disabled/without_subject/nested_test.rb b/test/bcdd/result/transitions/disabled/without_source/nested_test.rb similarity index 97% rename from test/bcdd/result/transitions/disabled/without_subject/nested_test.rb rename to test/bcdd/result/transitions/disabled/without_source/nested_test.rb index da30823..0095613 100644 --- a/test/bcdd/result/transitions/disabled/without_subject/nested_test.rb +++ b/test/bcdd/result/transitions/disabled/without_source/nested_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsDisabledWithoutSubjectNestedTest < Minitest::Test +class BCDD::Result::TransitionsDisabledWithoutSourceNestedTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/transitions/disabled/without_subject/recursion_test.rb b/test/bcdd/result/transitions/disabled/without_source/recursion_test.rb similarity index 94% rename from test/bcdd/result/transitions/disabled/without_subject/recursion_test.rb rename to test/bcdd/result/transitions/disabled/without_source/recursion_test.rb index d462ede..a187c9f 100644 --- a/test/bcdd/result/transitions/disabled/without_subject/recursion_test.rb +++ b/test/bcdd/result/transitions/disabled/without_source/recursion_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsDisabledWithoutSubjectRecursionTest < Minitest::Test +class BCDD::Result::TransitionsDisabledWithoutSourceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions def setup diff --git a/test/bcdd/result/transitions/enabled/with_subject/instance/flat_test.rb b/test/bcdd/result/transitions/enabled/with_source/instance/flat_test.rb similarity index 93% rename from test/bcdd/result/transitions/enabled/with_subject/instance/flat_test.rb rename to test/bcdd/result/transitions/enabled/with_source/instance/flat_test.rb index 9bfe0f5..24dfab9 100644 --- a/test/bcdd/result/transitions/enabled/with_subject/instance/flat_test.rb +++ b/test/bcdd/result/transitions/enabled/with_source/instance/flat_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithSubjectInstanceFlatTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithSourceInstanceFlatTest < Minitest::Test include BCDDResultTransitionAssertions class Division @@ -132,7 +132,7 @@ def divide((num1, num2)) { result: { kind: :failure, type: :division_by_zero, value: 'num2 cannot be zero' }, - and_then: { type: :method, arg: nil, subject: division3, method_name: :check_for_zeros } + and_then: { type: :method, arg: nil, source: division3, method_name: :check_for_zeros } }.then { |spec| assert_division_transition(result3, 1, spec) } # --- @@ -148,7 +148,7 @@ def divide((num1, num2)) { result: { kind: :success, type: :division_completed, value: 0 }, - and_then: { type: :method, arg: nil, subject: division4, method_name: :check_for_zeros } + and_then: { type: :method, arg: nil, source: division4, method_name: :check_for_zeros } }.then { |spec| assert_division_transition(result4, 1, spec) } # --- @@ -164,12 +164,12 @@ def divide((num1, num2)) { result: { kind: :success, type: :continued, value: [4, 2] }, - and_then: { type: :method, arg: nil, subject: division5, method_name: :check_for_zeros } + and_then: { type: :method, arg: nil, source: division5, method_name: :check_for_zeros } }.then { |spec| assert_division_transition(result5, 1, spec) } { result: { kind: :success, type: :division_completed, value: 2 }, - and_then: { type: :method, arg: nil, subject: division5, method_name: :divide } + and_then: { type: :method, arg: nil, source: division5, method_name: :divide } }.then { |spec| assert_division_transition(result5, 2, spec) } # --- diff --git a/test/bcdd/result/transitions/enabled/with_subject/instance/nested_test.rb b/test/bcdd/result/transitions/enabled/with_source/instance/nested_test.rb similarity index 96% rename from test/bcdd/result/transitions/enabled/with_subject/instance/nested_test.rb rename to test/bcdd/result/transitions/enabled/with_source/instance/nested_test.rb index 50aae29..db34c78 100644 --- a/test/bcdd/result/transitions/enabled/with_subject/instance/nested_test.rb +++ b/test/bcdd/result/transitions/enabled/with_source/instance/nested_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithSubjectInstanceNestedTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithSourceInstanceNestedTest < Minitest::Test include BCDDResultTransitionAssertions class Division @@ -222,7 +222,7 @@ def divide_by_two(num) parent: root, current: { id: Integer, name: 'Division', desc: nil }, result: { kind: :success, type: :division_completed, value: 10 }, - and_then: { type: :method, arg: 'useless_arg', subject: -> { _1.is_a?(Division) }, method_name: :divide } + and_then: { type: :method, arg: 'useless_arg', source: -> { _1.is_a?(Division) }, method_name: :divide } }.then { |spec| assert_transition_record(result, 4, spec) } # 3rd division transitions @@ -258,7 +258,7 @@ def divide_by_two(num) parent: root, current: { id: Integer, name: 'Division', desc: nil }, result: { kind: :success, type: :division_completed, value: 0 }, - and_then: { type: :method, arg: 'useless_arg', subject: -> { _1.is_a?(Division) }, method_name: :divide } + and_then: { type: :method, arg: 'useless_arg', source: -> { _1.is_a?(Division) }, method_name: :divide } }.then { |spec| assert_transition_record(result, 8, spec) } # Final result transition diff --git a/test/bcdd/result/transitions/enabled/with_subject/instance/recursion_test.rb b/test/bcdd/result/transitions/enabled/with_source/instance/recursion_test.rb similarity index 92% rename from test/bcdd/result/transitions/enabled/with_subject/instance/recursion_test.rb rename to test/bcdd/result/transitions/enabled/with_source/instance/recursion_test.rb index 1b4daa5..985194f 100644 --- a/test/bcdd/result/transitions/enabled/with_subject/instance/recursion_test.rb +++ b/test/bcdd/result/transitions/enabled/with_source/instance/recursion_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithSubjectInstanceRecursionTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithSourceInstanceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions class Fibonacci diff --git a/test/bcdd/result/transitions/enabled/with_subject/singleton/flat_test.rb b/test/bcdd/result/transitions/enabled/with_source/singleton/flat_test.rb similarity index 96% rename from test/bcdd/result/transitions/enabled/with_subject/singleton/flat_test.rb rename to test/bcdd/result/transitions/enabled/with_source/singleton/flat_test.rb index ffe1e92..7c5cee7 100644 --- a/test/bcdd/result/transitions/enabled/with_subject/singleton/flat_test.rb +++ b/test/bcdd/result/transitions/enabled/with_source/singleton/flat_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithSubjectSingletonFlatTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithSourceSingletonFlatTest < Minitest::Test include BCDDResultTransitionAssertions module Division diff --git a/test/bcdd/result/transitions/enabled/with_subject/singleton/nested_test.rb b/test/bcdd/result/transitions/enabled/with_source/singleton/nested_test.rb similarity index 98% rename from test/bcdd/result/transitions/enabled/with_subject/singleton/nested_test.rb rename to test/bcdd/result/transitions/enabled/with_source/singleton/nested_test.rb index 64a8058..90e2143 100644 --- a/test/bcdd/result/transitions/enabled/with_subject/singleton/nested_test.rb +++ b/test/bcdd/result/transitions/enabled/with_source/singleton/nested_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithSubjectSingletonNestedTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithSourceSingletonNestedTest < Minitest::Test include BCDDResultTransitionAssertions module CheckForZeros diff --git a/test/bcdd/result/transitions/enabled/with_subject/singleton/recursion_test.rb b/test/bcdd/result/transitions/enabled/with_source/singleton/recursion_test.rb similarity index 92% rename from test/bcdd/result/transitions/enabled/with_subject/singleton/recursion_test.rb rename to test/bcdd/result/transitions/enabled/with_source/singleton/recursion_test.rb index 87c4fcd..9b1d0af 100644 --- a/test/bcdd/result/transitions/enabled/with_subject/singleton/recursion_test.rb +++ b/test/bcdd/result/transitions/enabled/with_source/singleton/recursion_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithSubjectSingletonRecursionTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithSourceSingletonRecursionTest < Minitest::Test include BCDDResultTransitionAssertions module Fibonacci diff --git a/test/bcdd/result/transitions/enabled/without_subject/instance/flat_test.rb b/test/bcdd/result/transitions/enabled/without_source/instance/flat_test.rb similarity index 96% rename from test/bcdd/result/transitions/enabled/without_subject/instance/flat_test.rb rename to test/bcdd/result/transitions/enabled/without_source/instance/flat_test.rb index 5960384..2ecb29f 100644 --- a/test/bcdd/result/transitions/enabled/without_subject/instance/flat_test.rb +++ b/test/bcdd/result/transitions/enabled/without_source/instance/flat_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithoutSubjectInstanceFlatTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithoutSourceInstanceFlatTest < Minitest::Test include BCDDResultTransitionAssertions class Division diff --git a/test/bcdd/result/transitions/enabled/without_subject/instance/nested_test.rb b/test/bcdd/result/transitions/enabled/without_source/instance/nested_test.rb similarity index 97% rename from test/bcdd/result/transitions/enabled/without_subject/instance/nested_test.rb rename to test/bcdd/result/transitions/enabled/without_source/instance/nested_test.rb index 3ab3333..f4eaf68 100644 --- a/test/bcdd/result/transitions/enabled/without_subject/instance/nested_test.rb +++ b/test/bcdd/result/transitions/enabled/without_source/instance/nested_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithoutSubjectInstanceNestedTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithoutSourceInstanceNestedTest < Minitest::Test include BCDDResultTransitionAssertions class Division diff --git a/test/bcdd/result/transitions/enabled/without_subject/instance/recursion_test.rb b/test/bcdd/result/transitions/enabled/without_source/instance/recursion_test.rb similarity index 92% rename from test/bcdd/result/transitions/enabled/without_subject/instance/recursion_test.rb rename to test/bcdd/result/transitions/enabled/without_source/instance/recursion_test.rb index 6ee0a1c..06128bb 100644 --- a/test/bcdd/result/transitions/enabled/without_subject/instance/recursion_test.rb +++ b/test/bcdd/result/transitions/enabled/without_source/instance/recursion_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithoutSubjectInstanceRecursionTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithoutSourceInstanceRecursionTest < Minitest::Test include BCDDResultTransitionAssertions class Fibonacci diff --git a/test/bcdd/result/transitions/enabled/without_subject/singleton/flat_test.rb b/test/bcdd/result/transitions/enabled/without_source/singleton/flat_test.rb similarity index 96% rename from test/bcdd/result/transitions/enabled/without_subject/singleton/flat_test.rb rename to test/bcdd/result/transitions/enabled/without_source/singleton/flat_test.rb index fe4733c..8d8fdd1 100644 --- a/test/bcdd/result/transitions/enabled/without_subject/singleton/flat_test.rb +++ b/test/bcdd/result/transitions/enabled/without_source/singleton/flat_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithoutSubjectSingletonFlatTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithoutSourceSingletonFlatTest < Minitest::Test include BCDDResultTransitionAssertions module Division diff --git a/test/bcdd/result/transitions/enabled/without_subject/singleton/nested_test.rb b/test/bcdd/result/transitions/enabled/without_source/singleton/nested_test.rb similarity index 97% rename from test/bcdd/result/transitions/enabled/without_subject/singleton/nested_test.rb rename to test/bcdd/result/transitions/enabled/without_source/singleton/nested_test.rb index 5ba4516..11c3902 100644 --- a/test/bcdd/result/transitions/enabled/without_subject/singleton/nested_test.rb +++ b/test/bcdd/result/transitions/enabled/without_source/singleton/nested_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithoutSubjectSingletonNestedTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithoutSourceSingletonNestedTest < Minitest::Test include BCDDResultTransitionAssertions module Division diff --git a/test/bcdd/result/transitions/enabled/without_subject/singleton/recursion_test.rb b/test/bcdd/result/transitions/enabled/without_source/singleton/recursion_test.rb similarity index 92% rename from test/bcdd/result/transitions/enabled/without_subject/singleton/recursion_test.rb rename to test/bcdd/result/transitions/enabled/without_source/singleton/recursion_test.rb index 07e0beb..1f26e97 100644 --- a/test/bcdd/result/transitions/enabled/without_subject/singleton/recursion_test.rb +++ b/test/bcdd/result/transitions/enabled/without_source/singleton/recursion_test.rb @@ -2,7 +2,7 @@ require 'test_helper' -class BCDD::Result::TransitionsEnabledWithoutSubjectSingletonRecursionTest < Minitest::Test +class BCDD::Result::TransitionsEnabledWithoutSourceSingletonRecursionTest < Minitest::Test include BCDDResultTransitionAssertions module Fibonacci