test/test_helper.rb in trailblazer-macro-2.1.11 vs test/test_helper.rb in trailblazer-macro-2.1.12

- old
+ new

@@ -42,5 +42,34 @@ seq << :rehash raise "nope!" if rehash_raise true end end + +Minitest::Spec.include Trailblazer::Activity::Testing::Assertions + +Minitest::Spec.class_eval do + def trace(activity, ctx) + stack, signal, (ctx, _) = Trailblazer::Developer::Trace.invoke(activity, [ctx, {}]) + return Trailblazer::Developer::Trace::Present.(stack, node_options: {stack.to_a[0]=>{label: "TOP"}}).gsub(/:\d+/, ""), signal, ctx + end +end + + + +# signal, (ctx, _) = Trailblazer::Activity.(Song::Activity::Create, +# params: {title: "Olympia"}, # some random variable. +# "model.class": Hit, +# "model.action": :find_by, +# "model.find_by_key": :title, seq: [] +# ) + +# #:update-ok +# signal, (ctx, _) = Trailblazer::Activity.(Song::Activity::Update, params: {id: 1}, seq: []) +# ctx[:model] #=> #<Song id=1, ...> +# puts signal #=> #<Trailblazer::Activity::End semantic=:success> +# #:update-ok end + + +# require "trailblazer/core" +# Trailblazer::Core.convert_operation_test("test/docs/model_test.rb") +# Trailblazer::Core.convert_operation_test("test/docs/each_test.rb")