Sha256: e8227d861e6f5b19bff682c4dd9ee96937bdce94af91bd1df962e083e97667da

Contents?: true

Size: 714 Bytes

Versions: 3

Compression:

Stored size: 714 Bytes

Contents

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

describe "GeoIPs" do
  before(:all) do
    @api_key = File.read(File.dirname(__FILE__) + '/../.api_key')
  end
  
  it "should require an API key at initialization" do
    expect { GeoIPs.new }.to raise_error
  end
  
  describe "#lookup", :vcr => 'geoips_response' do
    before(:all) do
      @geo_ips = GeoIPs.new(@api_key)
    end
    
    it "should respond to lookup" do
      @geo_ips.respond_to?(:lookup).should be true
    end
    
    it "should require an IP" do
     expect { @geo_ips.lookup }.to raise_error
    end
    
    it "should respond with 13 items" do
      @geo_ips.lookup("8.8.8.8").should have(13).items
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geo_ips-0.1.2 spec/geo_ips_spec.rb
geo_ips-0.1.1 spec/geo_ips_spec.rb
geo_ips-0.1.0 spec/geo_ips_spec.rb