Sha256: 9498a2669fcd63814bfb92e6b2a853d519c9134de2a3172b89b1d30fce56b75b

Contents?: true

Size: 812 Bytes

Versions: 19

Compression:

Stored size: 812 Bytes

Contents

require File.dirname(__FILE__) + '/../lib/yawast'
require File.dirname(__FILE__) + '/base'

class TestCommandUtils < Minitest::Test
  include TestBase

  def test_valid_url
    args = ['http://www.apple.com']
    uri = Yawast::Commands::Utils.extract_uri args
    assert_equal uri.to_s, 'http://www.apple.com/'
  end

  def test_partial_url
    args = ['www.apple.com']
    uri = Yawast::Commands::Utils.extract_uri args
    assert_equal uri.to_s, 'http://www.apple.com/'
  end

  def test_invalid_url
    args = ['xxx:\invalid']

    assert_raises URI::InvalidURIError do
      Yawast::Commands::Utils.extract_uri args
    end
  end

  def test_unresolvable_url
    args = ['http://www.gjhgjhbmnbmnvgccf.com']

    assert_raises ArgumentError do
      Yawast::Commands::Utils.extract_uri args
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
yawast-0.6.0.beta5 test/test_cmd_util.rb
yawast-0.6.0.beta4 test/test_cmd_util.rb
yawast-0.6.0.beta3 test/test_cmd_util.rb
yawast-0.6.0.beta2 test/test_cmd_util.rb
yawast-0.6.0.beta1 test/test_cmd_util.rb
yawast-0.5.2 test/test_cmd_util.rb
yawast-0.5.1 test/test_cmd_util.rb
yawast-0.5.1.beta1 test/test_cmd_util.rb
yawast-0.5.0 test/test_cmd_util.rb
yawast-0.5.0.beta8 test/test_cmd_util.rb
yawast-0.5.0.beta7 test/test_cmd_util.rb
yawast-0.5.0.beta6 test/test_cmd_util.rb
yawast-0.5.0.beta5 test/test_cmd_util.rb
yawast-0.5.0.beta4 test/test_cmd_util.rb
yawast-0.5.0.beta3 test/test_cmd_util.rb
yawast-0.5.0.beta2 test/test_cmd_util.rb
yawast-0.5.0.beta1 test/test_cmd_util.rb
yawast-0.4.0 test/test_cmd_util.rb
yawast-0.4.0.beta5 test/test_cmd_util.rb