Fix accessory name check in with_accessory
This commit is contained in:
@@ -226,7 +226,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
|
||||
|
||||
private
|
||||
def with_accessory(name)
|
||||
if accessory = KAMAL.accessory(name)
|
||||
if KAMAL.config.accessory(name)
|
||||
accessory = KAMAL.accessory(name)
|
||||
yield accessory, accessory_hosts(accessory)
|
||||
else
|
||||
error_on_missing_accessory(name)
|
||||
|
||||
@@ -79,6 +79,10 @@ class CliAccessoryTest < CliTestCase
|
||||
assert_match "docker ps --filter label=service=app-mysql", run_command("details", "mysql")
|
||||
end
|
||||
|
||||
test "details with non-existent accessory" do
|
||||
assert_equal "No accessory by the name of 'hello' (options: mysql and redis)", stderred { run_command("details", "hello") }
|
||||
end
|
||||
|
||||
test "details with all" do
|
||||
run_command("details", "all").tap do |output|
|
||||
assert_match "docker ps --filter label=service=app-mysql", output
|
||||
|
||||
Reference in New Issue
Block a user