diff --git a/test/commands/registry_test.rb b/test/commands/registry_test.rb new file mode 100755 index 00000000..390f2208 --- /dev/null +++ b/test/commands/registry_test.rb @@ -0,0 +1,25 @@ +require "test_helper" +require "mrsk/configuration" +require "mrsk/commands/registry" + +class CommandsRegistryTest < ActiveSupport::TestCase + setup do + @config = { service: "app", + image: "dhh/app", + registry: { "username" => "dhh", + "password" => "secret", + "server" => "hub.docker.com" + }, + servers: [ "1.1.1.1" ] + } + @registry = Mrsk::Commands::Registry.new Mrsk::Configuration.new(@config) + end + + test "registry login" do + assert_equal [ :docker, :login, "hub.docker.com", "-u", "dhh", "-p", "secret" ], @registry.login + end + + test "registry logout" do + assert_equal [:docker, :logout, "hub.docker.com"], @registry.logout + end +end