Sha256: b99e16ae13f1649d2f474ebd50e5567dd52ed37e966c0a856672cdd03995c6b2

Contents?: true

Size: 618 Bytes

Versions: 5

Compression:

Stored size: 618 Bytes

Contents

require 'test_helper'

class TestLinkValidator < Test::Unit::TestCase
  def is_valid?(link)
    @validator = Spieker::LinkValidator.new(link, 'http://www.google.com').valid?
  end

  def test_normal_local_link
    [
    'http://www.google.com/local',
      '/local',
      ''
    ].each do |link|
      assert is_valid?(link), "Expected #{link} to be valid"
    end
  end

  def test_email
    assert !is_valid?('mailto:timonv@gmail.com')
  end

  def test_javascript
    assert !is_valid?('javascript')
  end

  def test_pdf
    assert !is_valid?('pdf')
  end

  def test_data
    assert !is_valid?('data')
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spieker-0.0.10 test/link_validator_test.rb
spieker-0.0.9 test/link_validator_test.rb
spieker-0.0.8 test/link_validator_test.rb
spieker-0.0.7 test/link_validator_test.rb
spieker-0.0.3 test/link_validator_test.rb