- Report more detailed error messages in exceptions about validation failures.
?
- Let custom validations use errors.add instead of raising exceptions
- Let your test check errors after calling valid, instead of checking whether calling call raises exceptions (we advise you wrap the old tests in a helper, before upgrading, so you only need to update your helper)
- Rename all your
valid?
methods tovalidate
. If you calledvalid?
on your operations, you can continue to do so.
Skip this version
- Change your expectations to expect
Pavlov.command
with hash arguments instead ofPavlov.old_command
with positional arguments. Same forquery
andinteractor
- Change all your invocations to call command with hash arguments instead of old_command. Same for
query
andinteractor
.
- If you use validations, you must now either use alpha_compatibility, or copy them to your own codebase.
- change all calls to the constructor of operations to construct with named parameters instead of positional parameters
- change all tests for authorization and validation, since those now get called when invoking
#call
instead of on initialization
- change tests which expect invocations of validations to tests which check whether an error has been thrown when you give it invalid input.
- change tests where you check whether authorized? is called, to ones where you invoke the operation without any prior checks, and catch
Pavlov::AccessDenied
which is thrown when an operation is unauthorized. - always call arguments, also when the operation has no arguments. Then just invoke
arguments
without any arguments.
- change all your specs/test to expect
old_command
,old_query
andold_interactor
instead ofcommand
,query
andinteractor
- change all tests to expect
command
,query
andinteractor
to be called on the module Pavlov, instead of on the object under test.
- Where you require pavlov, also 'pavlov/alpha_compatibility' instead
- change all calls of
query
,command
andinteractor
toold_query
,old_command
,old_query
- change all references to
@options
in interactors, commands and queries topavlov_options
This guide assumes you're at least at 0.1.0