Sha256: 9f68a0e6ad0d1a82460ead3134a3b7a6bd74907a6dc7ecbe77e1f1aa4a143ae6

Contents?: true

Size: 713 Bytes

Versions: 14

Compression:

Stored size: 713 Bytes

Contents

require 'sunzi'
require 'test/unit'

class TestCli < Test::Unit::TestCase
  def setup
    @cli = Sunzi::Cli.new
  end

  def test_parse_target
    assert_equal ['user', 'example.com', '2222'], @cli.parse_target('user@example.com:2222')
    assert_equal ['root', 'example.com', '2222'], @cli.parse_target('example.com:2222')
    assert_equal ['user', 'example.com', '22'],   @cli.parse_target('user@example.com')
    assert_equal ['root', 'example.com', '22'],   @cli.parse_target('example.com')
    assert_equal ['root', '192.168.0.1', '22'],   @cli.parse_target('192.168.0.1')
  end

  def test_create
    @cli.create 'sandbox'
    assert File.exist?('sandbox/sunzi.yml')
    FileUtils.rm_rf 'sandbox'
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sunzi-1.2.0 test/test_cli.rb
sunzi-1.1.2 test/test_cli.rb
sunzi-1.1.1 test/test_cli.rb
sunzi-1.1.0 test/test_cli.rb
sunzi-1.0.0 test/test_cli.rb
sunzi-0.9.0 test/test_cli.rb
sunzi-0.8.0 test/test_cli.rb
sunzi-0.7.0 test/test_cli.rb
sunzi-0.6.0 test/test_cli.rb
sunzi-0.5.1 test/test_cli.rb
sunzi-0.5.0 test/test_cli.rb
sunzi-0.4.4 test/test_cli.rb
sunzi-0.4.3 test/test_cli.rb
sunzi-0.4.2 test/test_cli.rb