diff --git a/test/commands/prune_test.rb b/test/commands/prune_test.rb new file mode 100644 index 00000000..d3e53deb --- /dev/null +++ b/test/commands/prune_test.rb @@ -0,0 +1,27 @@ +require "test_helper" + +class CommandsPruneTest < ActiveSupport::TestCase + setup do + @config = { + service: "app", image: "dhh/app", registry: { "username" => "dhh", "password" => "secret" }, servers: [ "1.1.1.1" ], + traefik: { "args" => { "accesslog.format" => "json", "metrics.prometheus.buckets" => "0.1,0.3,1.2,5.0" } } + } + end + + test "images" do + assert_equal \ + "docker image prune --force --filter until=168h", + new_command.images.join(" ") + end + + test "containers" do + assert_equal \ + "docker image prune --force --filter until=168h", + new_command.images.join(" ") + end + + private + def new_command + Mrsk::Commands::Prune.new(Mrsk::Configuration.new(@config, version: "123")) + end +end