From d11667dab317634ec6fc7491d737b9551e2bd8de Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Fri, 24 May 2024 08:27:15 +0100 Subject: [PATCH] chore: fix deprecation warning --- test/docs/each_test.rb | 4 ++-- test/docs/nested_static_test.rb | 2 +- test/docs/pundit_test.rb | 2 +- test/docs/rescue_test.rb | 14 +++++++------- test/docs/wrap_test.rb | 2 +- test/operation/integration_test.rb | 8 +++----- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/test/docs/each_test.rb b/test/docs/each_test.rb index 4665ba0..ffb68df 100644 --- a/test/docs/each_test.rb +++ b/test/docs/each_test.rb @@ -602,7 +602,7 @@ class EachStrategyComplianceTest < Minitest::Spec cover_patched.include(T.def_steps(:log_email, :notify_composers)) #@ Original class isn't changed. - assert_invoke Song::Activity::Cover, params: {id: 1}, seq: [], + assert_invoke Song::Activity::Cover, params: {id: 1}, expected_ctx_variables: { model: Song.find_by(id: 1), }, @@ -610,7 +610,7 @@ class EachStrategyComplianceTest < Minitest::Spec #@ Patched class runs # Trailblazer::Developer.wtf?(cover_patched, [params: {id: 1}, seq: []]) - assert_invoke cover_patched, params: {id: 1}, seq: [], + assert_invoke cover_patched, params: {id: 1}, expected_ctx_variables: { model: Song.find_by(id: 1), }, diff --git a/test/docs/nested_static_test.rb b/test/docs/nested_static_test.rb index 9eacb3a..e224312 100644 --- a/test/docs/nested_static_test.rb +++ b/test/docs/nested_static_test.rb @@ -370,7 +370,7 @@ class Create < Trailblazer::Activity::Railway end end #:dynamic-output end - end + end end # B assert_equal exception.message[0..34], %{No `unsupported_file_format` output} diff --git a/test/docs/pundit_test.rb b/test/docs/pundit_test.rb index 61a8773..b263b7e 100644 --- a/test/docs/pundit_test.rb +++ b/test/docs/pundit_test.rb @@ -46,7 +46,7 @@ class Create < Trailblazer::Operation #--- #- override class New < Create - step Policy::Pundit( MyPolicy, :new? ), override: true + step Policy::Pundit( MyPolicy, :new? ), replace: :"policy.default.eval" end it { assert_equal Trailblazer::Developer.railway(New), %{[>model.build,>policy.default.eval]} } diff --git a/test/docs/rescue_test.rb b/test/docs/rescue_test.rb index 69ca6c6..4ab7a12 100644 --- a/test/docs/rescue_test.rb +++ b/test/docs/rescue_test.rb @@ -212,13 +212,13 @@ def self.call(*) # assert_equal Trailblazer::Developer::Introspect.find_path(activity, ["Each-1"])[0].id, "Each-1" # assert_equal Trailblazer::Developer::Introspect.find_path(activity, ["Each/composers_for_each"])[0].id, "Each/composers_for_each" - assert_match /Rescue\/\d+/, Trailblazer::Activity::Introspect::Nodes(activity).values[1].id - assert_match /Rescue\/\d+/, Trailblazer::Activity::Introspect::Nodes(activity).values[2].id - assert_match /Rescue\/\d+/, Trailblazer::Activity::Introspect::Nodes(activity).values[3].id - assert_match "Rescue-1", Trailblazer::Activity::Introspect::Nodes(activity).values[4].id - assert_match "Rescue-2", Trailblazer::Activity::Introspect::Nodes(activity).values[5].id - assert_match /Rescue\/\d+/, Trailblazer::Activity::Introspect::Nodes(activity).values[6].id - assert_match /Rescue\/\d+/, Trailblazer::Activity::Introspect::Nodes(activity).values[7].id + assert_match (/Rescue\/\d+/), Trailblazer::Activity::Introspect::Nodes(activity).values[1].id + assert_match (/Rescue\/\d+/), Trailblazer::Activity::Introspect::Nodes(activity).values[2].id + assert_match (/Rescue\/\d+/), Trailblazer::Activity::Introspect::Nodes(activity).values[3].id + assert_equal "Rescue-1", Trailblazer::Activity::Introspect::Nodes(activity).values[4].id + assert_equal "Rescue-2", Trailblazer::Activity::Introspect::Nodes(activity).values[5].id + assert_match (/Rescue\/\d+/), Trailblazer::Activity::Introspect::Nodes(activity).values[6].id + assert_match (/Rescue\/\d+/), Trailblazer::Activity::Introspect::Nodes(activity).values[7].id end end diff --git a/test/docs/wrap_test.rb b/test/docs/wrap_test.rb index c73f867..86be888 100644 --- a/test/docs/wrap_test.rb +++ b/test/docs/wrap_test.rb @@ -458,7 +458,7 @@ class WrapWithTransactionTest < Minitest::Spec module Sequel def self.transaction - end_event, (ctx, flow_options) = yield + _end_event, (_ctx, _flow_options) = yield end end diff --git a/test/operation/integration_test.rb b/test/operation/integration_test.rb index 8fac905..5325d4b 100644 --- a/test/operation/integration_test.rb +++ b/test/operation/integration_test.rb @@ -30,12 +30,12 @@ def save!(_options, params:, model:, **) end class SongSpecialCreate < Trailblazer::Operation - step Nested(ArtistCreate) - step Nested(SongCreate) + step Subprocess(ArtistCreate) + step Subprocess(SongCreate) end it "create Artist and Song" do - result = SongSpecialCreate.trace( + result = SongSpecialCreate.wtf?( params: { artist: { name: "My Artist" @@ -46,8 +46,6 @@ class SongSpecialCreate < Trailblazer::Operation } ) - puts result.wtf? - # this should return song assert_equal result[:model].name, "My Song" assert_equal result[:model].artist_name, "My Artist"