Sha256: bf6fe6fdabc29c26c8eb50d2bcfda00a48b622a3203a7ef8e06814b641e510b4

Contents?: true

Size: 579 Bytes

Versions: 2

Compression:

Stored size: 579 Bytes

Contents

require 'helper'

describe Twitter::GeoFactory do

  describe ".new" do
    it "generates a Point" do
      geo = Twitter::GeoFactory.fetch_or_new(:type => 'Point')
      geo.should be_a Twitter::Geo::Point
    end
    it "generates a Polygon" do
      geo = Twitter::GeoFactory.fetch_or_new(:type => 'Polygon')
      geo.should be_a Twitter::Geo::Polygon
    end
    it "raises an ArgumentError when type is not specified" do
      lambda do
        Twitter::GeoFactory.fetch_or_new
      end.should raise_error(ArgumentError, "argument must have :type key")
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter-4.1.0 spec/twitter/geo_factory_spec.rb
twitter-4.0.0 spec/twitter/geo_factory_spec.rb