test/docs/doormat_test.rb in trailblazer-operation-0.4.1 vs test/docs/doormat_test.rb in trailblazer-operation-0.5.0
- old
+ new
@@ -3,11 +3,11 @@
class TemplateWithGroupTest < Minitest::Spec
module Memo; end
#:template
class Memo::Operation < Trailblazer::Operation
- step :log_call, group: :start
+ step :log_call, group: :start
step :log_success, group: :end, before: "End.success"
fail :log_errors, group: :end, before: "End.failure"
#~tmethods
# our success "end":
@@ -47,26 +47,28 @@
#~meths end
end
#:template-user end
# it { pp F['__sequence__'].to_a }
- it { Memo::Create.(params: {}, "b_return" => false,
- ).inspect("row").must_equal %{<Result:true [[:a, :l, :b, :c, :z]] >} }
+ it {
+ skip
+ Memo::Create.(params: {}, "b_return" => false).inspect("row").must_equal %{<Result:true [[:a, :l, :b, :c, :z]] >}
+ }
end
class DoormatWithGroupTest < Minitest::Spec
module Memo; end
#:doormat-group
class Memo::Create < Trailblazer::Operation
step :create_model
- step :log_success, group: :end, before: "End.success"
+ step :log_success, group: :end, before: "End.success"
step :validate
step :save
- fail :log_errors, group: :end, before: "End.failure"
+ fail :log_errors, group: :end, before: "End.failure"
#~methods
def create_model(options, **)
options["row"] = [:a]
end
@@ -91,12 +93,14 @@
#~methods end
end
#:doormat-group end
# it { pp F['__sequence__'].to_a }
- it { Memo::Create.(params: {}, "b_return" => false,
- ).inspect("row").must_equal %{<Result:true [[:a, :b, :c, :z]] >} }
+ it {
+ skip
+ Memo::Create.(params: {}, "b_return" => false).inspect("row").must_equal %{<Result:true [[:a, :b, :c, :z]] >}
+ }
end
class DoormatStepDocsTest < Minitest::Spec
module Memo; end
@@ -135,12 +139,11 @@
#~im end
end
#:doormat-before end
# it { pp F['__sequence__'].to_a }
- it { Memo::Create.(params: {}, "b_return" => false,
- ).inspect("row").must_equal %{<Result:true [[:a, :b, :c, :z]] >} }
+ it { Memo::Create.(params: {}, "b_return" => false).inspect("row").must_equal %{<Result:true [[:a, :b, :c, :z]] >} }
end
class DoormatInheritanceTest < Minitest::Spec
#:doormatx-before-inheritance
class Base < Trailblazer::Operation
@@ -181,9 +184,7 @@
#~ignoredd end
end
#:doormat-before-inheritance-sub end
# it { pp F['__sequence__'].to_a }
- it { Create.({}, "b_return" => false,
- ).inspect("row").must_equal %{<Result:true [[:a, :b, :c, :z]] >} }
+ it { Create.("b_return" => false).inspect("row").must_equal %{<Result:true [[:a, :b, :c, :z]] >} }
end
-