Sha256: 2b189fea477d57c21b2c6e7a5f387253e5e76f499eff6933eecabfc306199259

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

require 'test/unit'
require '../lib/sunzi'

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
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sunzi-0.4.0 test/test_cli.rb
sunzi-0.3.0 test/test_cli.rb