Sha256: abf4bebca7ff2a527cac1653dc8f7e167c33be1e1c3b9d5ce814fbe7a3a0a15d

Contents?: true

Size: 658 Bytes

Versions: 1

Compression:

Stored size: 658 Bytes

Contents

require 'helper'

VALID = ["foo.gov", "http://foo.mil", "foo@bar.gc.ca", "foo.gov.au", "http://www.foo.gouv.fr", "foo@ci.champaign.il.us", "foo.bar.baz.gov.au"]
INVALID = ["foo.bar.com", "bar@foo.biz", "http://www.foo.biz", "foo.uk", "gov", "foo@k12.champaign.il.us"]

class TestGman < Test::Unit::TestCase
  should "recognize government email addresses and domains" do
    VALID.each do |test|
      assert_equal true, Gman::valid?(test), "#{test} should be detected as a valid government domain"
    end
    INVALID.each do |test|
      assert_equal false, Gman::valid?(test), "#{test} should be detected as an invalid government domain"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gman-0.0.3 test/test_gman.rb