server-side-google-maps 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,7 @@ module ServerSideGoogleMaps
15
15
  end
16
16
 
17
17
  def ==(other)
18
+ return false unless Point === other
18
19
  latitude == other.latitude && longitude == other.longitude && object == other.object
19
20
  end
20
21
 
@@ -1,3 +1,3 @@
1
1
  module ServerSideGoogleMaps
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/spec/point_spec.rb CHANGED
@@ -69,5 +69,24 @@ module ServerSideGoogleMaps
69
69
  point1.distance(point2).should == 248412
70
70
  end
71
71
  end
72
+
73
+ describe('#==') do
74
+ it('should work with same latitude/longitudes') do
75
+ p1 = Point.new(1, 2)
76
+ p2 = Point.new(1, 2)
77
+ (p1 == p2).should == true
78
+ end
79
+
80
+ it('should work with different latitudes/longitudes') do
81
+ p1 = Point.new(1, 2)
82
+ p2 = Point.new(1, 4)
83
+ (p1 == p2).should == false
84
+ end
85
+
86
+ it('should work with a non-Point') do
87
+ p1 = Point.new(1, 2)
88
+ (p1 == true).should == false
89
+ end
90
+ end
72
91
  end
73
92
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: server-side-google-maps
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Hooper