Sha256: 66c8d1e5f47864d9508d1bd5b671eb0395e1200e630d38a969ce5e9328948068

Contents?: true

Size: 676 Bytes

Versions: 3

Compression:

Stored size: 676 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", "foo@bar.gov.uk"]
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

3 entries across 3 versions & 1 rubygems

Version Path
gman-0.0.6 test/test_gman.rb
gman-0.0.5 test/test_gman.rb
gman-0.0.4 test/test_gman.rb