From 5702f71c9839c69aba088e08c17cb8ddb3db44ab Mon Sep 17 00:00:00 2001 From: Nick Sutterer Date: Fri, 24 Nov 2023 15:27:01 +0100 Subject: [PATCH] remove outdated tests. --- test/docs/doormat_test.rb | 190 ------------------------------------- test/docs/macaroni_test.rb | 31 ------ 2 files changed, 221 deletions(-) delete mode 100644 test/docs/doormat_test.rb delete mode 100644 test/docs/macaroni_test.rb diff --git a/test/docs/doormat_test.rb b/test/docs/doormat_test.rb deleted file mode 100644 index a62d0d7..0000000 --- a/test/docs/doormat_test.rb +++ /dev/null @@ -1,190 +0,0 @@ -require "test_helper" - -class TemplateWithGroupTest < Minitest::Spec - module Memo; end - - #:template - class Memo::Operation < Trailblazer::Operation - 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": - def log_call(options, **) - options["row"] = [:a] - end - - # our success "end": - def log_success(options, **) - options["row"] << :z - end - - def log_errors(options, **) - options["row"] << :f - end - #~tmethods end - end - #:template end - - #:template-user - class Memo::Create < Memo::Operation - step :create_model - step :validate - step :save - #~meths - def create_model(options, **) - options["row"] << :l - end - - def validate(options, **) - options["row"] << :b - end - - def save(options, **) - options["row"] << :c - end - #~meths end - end - #:template-user end - - # it { pp F['__sequence__'].to_a } - it { - skip - Memo::Create.(params: {}, "b_return" => false).inspect("row").must_equal %{} - } -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 :validate - step :save - - fail :log_errors, group: :end, before: "End.failure" - #~methods - def create_model(options, **) - options["row"] = [:a] - end - - # our success "end": - def log_success(options, **) - options["row"] << :z - end - - # 2 - def validate(options, **) - options["row"] << :b - end - - # 3 - def save(options, **) - options["row"] << :c - end - - def log_errors(options, **) - options["row"] << :f - end - #~methods end - end - #:doormat-group end - - # it { pp F['__sequence__'].to_a } - it { - skip - Memo::Create.(params: {}, "b_return" => false).inspect("row").must_equal %{} - } -end - -class DoormatStepDocsTest < Minitest::Spec - module Memo; end - - #:doormat-before - class Memo::Create < Trailblazer::Operation - step :create_model - step :log_success - - step :validate, before: :log_success - step :save, before: :log_success - - fail :log_errors - #~im - def create_model(options, **) - options["row"] = [:a] - end - - # our success "end": - def log_success(options, **) - options["row"] << :z - end - - # 2 - def validate(options, **) - options["row"] << :b - end - - # 3 - def save(options, **) - options["row"] << :c - end - - def log_errors(options, **) - options["row"] << :f - end - #~im end - end - #:doormat-before end - - # it { pp F['__sequence__'].to_a } - it { Memo::Create.(params: {}, "b_return" => false).inspect("row").must_equal %{} } -end - -class DoormatInheritanceTest < Minitest::Spec - #:doormatx-before-inheritance - class Base < Trailblazer::Operation - step :log_success! - fail :log_errors! - #~ignored - # our success "end": - def log_success!(options, **) - options["row"] << :z - end - - def log_errors!(options, **) - options["row"] << :f - end - #~ignored end - end - #:doormatx-before-inheritance end - - #:doormat-before-inheritance-sub - class Create < Base - step :first, before: :log_success! - step :second, before: :log_success! - step :third, before: :log_success! - #~ignoredd - def first(options, **) - options["row"] = [:a] - end - - # 2 - def second(options, **) - options["row"] << :b - end - - # 3 - def third(options, **) - options["row"] << :c - end - #~ignoredd end - end - #:doormat-before-inheritance-sub end - - # it { pp F['__sequence__'].to_a } - it { Create.("b_return" => false).inspect("row").must_equal %{} } -end diff --git a/test/docs/macaroni_test.rb b/test/docs/macaroni_test.rb deleted file mode 100644 index 97dbb10..0000000 --- a/test/docs/macaroni_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -# require "test_helper" - -# class MacaroniTaskBuilderTest < Minitest::Spec -# Memo = Struct.new(:title) do -# def save -# self.title = title[:title].reverse -# end -# end - -# #:create -# class Memo::Create < Trailblazer::Operation(step_interface_builder: Trailblazer::Operation::Railway::KwSignature) -# #~ign -# step :create_model -# step :save -# #~ign end -# #~methods -# def create_model(params:, options:, **) -# options[:model] = Memo.new(title: params[:title]) -# end - -# def save(model:, **) -# model.save -# end -# #~methods end -# end -# #:create end - -# it "allows optional macaroni call style" do -# Memo::Create.(params: {title: "Wow!"}).inspect(:model).must_equal %{] >} -# end -# end