Skip to content

Commit

Permalink
update tests to new tracing API.
Browse files Browse the repository at this point in the history
update dependencies.
  • Loading branch information
apotonick committed Jun 14, 2023
1 parent fb5b033 commit 3a9f510
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
7 changes: 5 additions & 2 deletions test/docs/each_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,11 @@ def self.block

stack, signal, (ctx, _) = Trailblazer::Developer::Trace.invoke(activity, [ctx, {}])

assert_equal Trailblazer::Developer::Trace::Present.(stack,
node_options: {stack.to_a[0] => {label: "<a-Each-b>"}}), %{<a-Each-b>
output = Trailblazer::Developer::Trace::Present.(stack) do |trace_nodes:, **|
{node_options: {trace_nodes[0] => {label: "<a-Each-b>"}}}
end

assert_equal output, %{<a-Each-b>
|-- Start.default
|-- a
|-- Each/1
Expand Down
7 changes: 6 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def rehash(ctx, seq:, rehash_raise: false, **)
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

output = Trailblazer::Developer::Trace::Present.(stack) do |trace_nodes:, **|
{node_options: {trace_nodes[0] => {label: "TOP"}}}
end.gsub(/:\d+/, "")

return output, signal, ctx
end
end

Expand Down
2 changes: 1 addition & 1 deletion trailblazer-macro.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "minitest"
spec.add_development_dependency "rake"
spec.add_development_dependency "trailblazer-developer", ">= 0.1.0", "< 0.2.0"
spec.add_dependency "trailblazer-operation", ">= 0.10.0" # TODO: this dependency will be removed. currently needed for tests and for Guard::Result
spec.add_dependency "trailblazer-operation", ">= 0.10.1" # TODO: this dependency will be removed. currently needed for tests and for Guard::Result

spec.add_dependency "trailblazer-activity-dsl-linear", ">= 1.2.0", "< 1.3.0"

Expand Down

0 comments on commit 3a9f510

Please sign in to comment.