Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix deprecation warning #52

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/docs/each_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,15 @@ 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),
},
seq: "[:rearrange]"

#@ 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),
},
Expand Down
2 changes: 1 addition & 1 deletion test/docs/nested_static_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion test/docs/pundit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]} }
Expand Down
14 changes: 7 additions & 7 deletions test/docs/rescue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/docs/wrap_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 3 additions & 5 deletions test/operation/integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
Loading