Merge pull request #502 from latyshev/main
Fix accessory name checking that is passing to command `kamal accessory`
This commit is contained in:
@@ -226,7 +226,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
|
|||||||
|
|
||||||
private
|
private
|
||||||
def with_accessory(name)
|
def with_accessory(name)
|
||||||
if accessory = KAMAL.accessory(name)
|
if KAMAL.config.accessory(name)
|
||||||
|
accessory = KAMAL.accessory(name)
|
||||||
yield accessory, accessory_hosts(accessory)
|
yield accessory, accessory_hosts(accessory)
|
||||||
else
|
else
|
||||||
error_on_missing_accessory(name)
|
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")
|
assert_match "docker ps --filter label=service=app-mysql", run_command("details", "mysql")
|
||||||
end
|
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
|
test "details with all" do
|
||||||
run_command("details", "all").tap do |output|
|
run_command("details", "all").tap do |output|
|
||||||
assert_match "docker ps --filter label=service=app-mysql", output
|
assert_match "docker ps --filter label=service=app-mysql", output
|
||||||
|
|||||||
Reference in New Issue
Block a user