Sha256: bb6e2e0f6485c121067c6848b9d94f8e77044e7ae9236041862cdc1519f9489f

Contents?: true

Size: 1.12 KB

Versions: 2

Compression:

Stored size: 1.12 KB

Contents

require 'helper'

describe Twitter::Geo::Point do

  before do
    @point = Twitter::Geo::Point.new(:coordinates => [-122.399983, 37.788299])
  end

  describe "#==" do
    it "returns false for empty objects" do
      point = Twitter::Geo::Point.new
      other = Twitter::Geo::Point.new
      (point == other).should be_false
    end
    it "returns true when objects coordinates are the same" do
      other = Twitter::Geo::Point.new(:coordinates => [-122.399983, 37.788299])
      (@point == other).should be_true
    end
    it "returns false when objects coordinates are different" do
      other = Twitter::Geo::Point.new(:coordinates => [37.788299, -122.399983])
      (@point == other).should be_false
    end
    it "returns false when classes are different" do
      other = Twitter::Geo.new(:coordinates => [-122.399983, 37.788299])
      (@point == other).should be_false
    end
  end

  describe "#latitude" do
    it "returns the latitude" do
      @point.latitude.should eq(-122.399983)
    end
  end

  describe "#longitude" do
    it "returns the longitude" do
      @point.longitude.should eq 37.788299
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter-4.1.0 spec/twitter/geo/point_spec.rb
twitter-4.0.0 spec/twitter/geo/point_spec.rb