1
我正在使用Thor編寫CLI。它看起來像這樣:測試Thor CLI
module Cli
class Root < Thor
register Cli::Command :command, 'command [ARGUMENT]', 'description'
end
end
module Cli
class Command < Thor::Group
include Thor::Actions
argument :argument
def template
directory :template_dir, argument
end
end
end
現在我想測試這個。也就是說,我想測試模板是在給定相對路徑和絕對路徑的正確目錄下創建的。然而,我對如何去測試這個有點失望。任何幫助將不勝感激。