Sha256: 7ab4417331d62bfeef27d8f4cd3044b6218d165f3c1d777d02cc95e73d40fdb8
Contents?: true
Size: 841 Bytes
Versions: 83
Compression:
Stored size: 841 Bytes
Contents
require "utils" require 'capistrano/cli/ui' class CLIUITest < Test::Unit::TestCase class MockCLI include Capistrano::CLI::UI end def test_ui_should_return_highline_instance assert_instance_of HighLine, MockCLI.ui end def test_password_prompt_should_have_default_prompt_and_set_echo_false q = mock("question") q.expects(:echo=).with(false) ui = mock("ui") ui.expects(:ask).with("Password: ").yields(q).returns("sayuncle") MockCLI.expects(:ui).returns(ui) assert_equal "sayuncle", MockCLI.password_prompt end def test_password_prompt_with_custom_prompt_should_use_custom_prompt ui = mock("ui") ui.expects(:ask).with("Give the passphrase: ").returns("sayuncle") MockCLI.expects(:ui).returns(ui) assert_equal "sayuncle", MockCLI.password_prompt("Give the passphrase: ") end end
Version data entries
83 entries across 83 versions & 10 rubygems