Skip to content

Commit

Permalink
more docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Nov 17, 2023
1 parent 300a696 commit cb06479
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions test/docs/wiring_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,64 @@ def save(ctx, model:, **)
end
end

#@ Output => End
class OutputToEnd_WiringApiDocsTest < Minitest::Spec
Memo = Class.new
#:output-end
module Memo::Activity
class Create < Trailblazer::Activity::Railway
step :validate
step :save,
Output(:failure) => End(:db_error)
left :handle_errors
step :notify
#~meths
include T.def_steps(:validate, :save, :handle_errors, :notify)
#~meths end
end
end
#:output-end end

it "what" do
assert_invoke Memo::Activity::Create, seq: "[:validate, :save, :notify]"
assert_invoke Memo::Activity::Create, seq: "[:validate, :save]", save: false, terminus: :db_error
end
end

#@ #terminus
class Terminus_WiringApiDocsTest < Minitest::Spec
Memo = Class.new
#:terminus
module Memo::Activity
class CRUD < Trailblazer::Activity::Railway
step :validate
step :save
terminus :db_error
#~meths
include T.def_steps(:validate, :save, :handle_errors, :notify)
#~meths end
end
end
#:terminus end

#:terminus-sub
module Memo::Activity
class Create < CRUD
step :notify,
Output(:failure) => End(:db_error)
#~meths
include T.def_steps(:validate, :save, :handle_errors, :notify)
#~meths end
end
end
#:terminus-sub end

it "what" do
# assert_invoke Memo::Activity::Create, seq: "[:validate, :save, :notify]"
# assert_invoke Memo::Activity::Create, seq: "[:validate, :save]", save: false, terminus: :db_error
end
end

class WiringApiDocsTest < Minitest::Spec
# {#terminus} 1.0
module A
Expand All @@ -129,7 +187,7 @@ module Operation
end
end

#:terminus
#:terminus-
module Payment::Operation
class Create < Trailblazer::Activity::Railway
step :find_provider
Expand All @@ -140,7 +198,7 @@ class Create < Trailblazer::Activity::Railway
#~meths end
end
end
#:terminus end
#:terminus- end
# @diagram wiring-terminus
end

Expand Down

0 comments on commit cb06479

Please sign in to comment.