Sha256: 52cb4eb24ec82652c04bd43833f6189d7058f8f53076c2011667cc618ac6df98

Contents?: true

Size: 655 Bytes

Versions: 1

Compression:

Stored size: 655 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ip2proxy" do
  it "work correctly with ipv4" do
    i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP.SAMPLE.BIN")
    record = i2p.get_all('1.0.241.135')
    record.should_not be_nil
    record['is_proxy'].should == 1
    i2p.close()
  end

  it "work correctly with ipv6" do
    i2p = Ip2proxy.new.open(File.dirname(__FILE__) + "/assets/IP2PROXY-IP-PROXYTYPE-COUNTRY-REGION-CITY-ISP.SAMPLE.BIN")
    record = i2p.get_all('2001::')
    record.should_not be_nil
    record['is_proxy'].should == 0
    i2p.close()
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ip2proxy_ruby-1.0.3 spec/ip2proxy_ruby_spec.rb