Sha256: 67bcfc19987df6e805bd9ed459f27a6847bd3b118c41fbbfb6f0274332821058

Contents?: true

Size: 651 Bytes

Versions: 11

Compression:

Stored size: 651 Bytes

Contents

require 'test_helper'

class IpAddressesTest < Test::Unit::TestCase
  def setup
    @hash = { "ip_addresses" => ["134.122.0.0-134.122.149.239",
      "134.22.88.*", "134.165.*.*", "134.238.*.*", "134.168.224.0/23"] }
  end
  
  def test_ip_addresses
    assert_nothing_raised {
      institution = Institutions::Institution.new("my_inst", "My Institution", @hash)
    }
  end
  
  def test_include_ip?
    institution = Institutions::Institution.new("my_inst", "My Institution", @hash)
    assert institution.includes_ip? "134.165.4.1"
    assert institution.includes_ip? "134.168.224.255"
    assert institution.includes_ip? "134.122.21.12"
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
institutions-0.1.3 test/institution/ip_addresses_test.rb
institutions-0.1.2 test/institution/ip_addresses_test.rb
institutions-0.1.1 test/institution/ip_addresses_test.rb
institutions-0.1.0 test/institution/ip_addresses_test.rb
institutions-0.0.7 test/institution/ip_addresses_test.rb
institutions-0.0.6 test/institution/ip_addresses_test.rb
institutions-0.0.5 test/institution/ip_addresses_test.rb
institutions-0.0.4 test/institution/ip_addresses_test.rb
institutions-0.0.3 test/institution/ip_addresses_test.rb
institutions-0.0.2 test/institution/ip_addresses_test.rb
institutions-0.0.1 test/institution/ip_addresses_test.rb