Skip to content

Commit fe35e2a

Browse files
committed
make Suite work with the new :invoke architecture.
1 parent 7f612ee commit fe35e2a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/trailblazer/test/assertion/assert_fail.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ module AssertFail
77
extend AssertPass::Utils
88

99
# {expected_errors} can be nil when using the {#assert_fail} block syntax.
10-
def call(activity, ctx, expected_errors=nil, test:, invoke_method: :call, invoke:, **kws)
11-
signal, ctx, _ = invoke.(ctx, operation: activity, invoke_method: invoke_method) # FIXME: remove kws?
10+
def call(activity, ctx, expected_errors=nil, test:, invoke:, **kws)
11+
signal, ctx, _ = invoke.(ctx, operation: activity) # FIXME: remove kws?
1212

1313
assert_fail_with_model(signal, ctx, expected_errors: expected_errors, test: test, operation: activity, **kws)
1414
end

lib/trailblazer/test/assertion/suite.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def assert_pass(params_fragment, deep_merge: true, assertion:, test:, expected_a
5757

5858
activity = kws[:operation] # FIXME.
5959

60-
assertion.(activity, ctx, test: test, expected_model_attributes: expected_attributes, user_block: kws[:user_block], model_at: kws[:model_at], invoke_method: kws[:invoke_method])
60+
assertion.(activity, ctx, test: test, expected_model_attributes: expected_attributes, user_block: kws[:user_block], model_at: kws[:model_at], invoke: kws[:invoke])
6161
end
6262

6363
def assert_fail(params_fragment, expected_errors, assertion:, **kws)
@@ -78,7 +78,7 @@ def ctx_for_params_fragment(params_fragment, key_in_params:, default_ctx:, **)
7878

7979
# @private
8080
# Gather all test case configuration. This involves reading all test `let` directives.
81-
def normalize_kws(user_block:, test:, operation: test.operation, expected_attributes: test.expected_attributes, contract_name: "default", model_at: :model, use_wtf: false, invoke_method: :call, **options)
81+
def normalize_kws(user_block:, test:, operation: test.operation, expected_attributes: test.expected_attributes, contract_name: "default", model_at: :model, use_wtf: false, invoke: Assertion.method(:invoke_activity), **options)
8282
kws = {
8383
# user_block: user_block,
8484
operation: operation,
@@ -87,7 +87,7 @@ def normalize_kws(user_block:, test:, operation: test.operation, expected_attrib
8787
contract_name: contract_name,
8888
model_at: model_at,
8989
user_block: user_block,
90-
invoke_method: use_wtf ? :wtf? : invoke_method,
90+
invoke: use_wtf ? Assertion::Wtf.method(:invoke_activity) : invoke,
9191

9292
**normalize_kws_for_ctx(test: test, **options)
9393
}

0 commit comments

Comments
 (0)