Skip to content

Commit

Permalink
more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Nov 13, 2023
1 parent 62878cc commit dd2f33a
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion test/docs/step_dsl_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def validate(ctx, params:, **)


module B
class DocsStepTest < Minitest::Spec
class Fail_DocsStepTest < Minitest::Spec
Memo = Module.new

#:fail
Expand All @@ -66,3 +66,28 @@ class Create < Trailblazer::Operation
end
end
end

module A
class Pass_DocsStepTest < Minitest::Spec
Memo = Module.new

#:pass
module Memo::Operation
class Create < Trailblazer::Operation
step :validate
pass :save # no output goes to the failure track here.
left :handle_errors
#~meths
step :notify
include T.def_steps(:validate, :save, :handle_errors, :notify)
#~meths end
end
end
#:pass end

it "what" do
assert_invoke Memo::Operation::Create, seq: "[:validate, :save, :notify]"
assert_invoke Memo::Operation::Create, validate: false, terminus: :failure, seq: "[:validate, :handle_errors]"
end
end
end

0 comments on commit dd2f33a

Please sign in to comment.