lib/convenient_service/rspec/matchers/custom/results/base.rb in convenient_service-0.7.0 vs lib/convenient_service/rspec/matchers/custom/results/base.rb in convenient_service-0.8.0
- old
+ new
@@ -24,10 +24,15 @@
@result = result
rules = []
rules << ->(result) { result.class.include?(Service::Plugins::HasResult::Entities::Result::Concern) }
+
+ ##
+ # IMPORTANT: Result status is NOT marked as checked intentionally, since it is a mutable operation.
+ #
rules << ->(result) { result.status.in?(statuses) }
+
rules << ->(result) { result.service.instance_of?(service_class) } if used_of_service?
rules << ->(result) { Commands::MatchResultStep.call(result: result, step: step) } if used_of_step?
rules << ->(result) { result.unsafe_data == data } if used_data?
rules << ->(result) { result.unsafe_message == message } if used_message?
rules << ->(result) { result.unsafe_code == code } if used_code?