Add configuration for hooks_path

This commit is contained in:
Donal McBreen
2023-05-22 11:09:13 +01:00
parent f3ec9f19c8
commit 910f14e9c0
4 changed files with 21 additions and 5 deletions

View File

@@ -25,8 +25,18 @@ class CommandsHookTest < ActiveSupport::TestCase
], new_command.run("foo")
end
test "run with custom hooks_path" do
assert_equal [
"custom/hooks/path/foo",
{ env: {
"MRSK_RECORDED_AT" => @recorded_at,
"MRSK_PERFORMER" => @performer,
"MRSK_VERSION" => "123" } }
], new_command(hooks_path: "custom/hooks/path").run("foo")
end
private
def new_command
Mrsk::Commands::Hook.new(Mrsk::Configuration.new(@config, version: "123"))
def new_command(**extra_config)
Mrsk::Commands::Hook.new(Mrsk::Configuration.new(@config.merge(**extra_config), version: "123"))
end
end