latinum 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c23ebdb9df8ce74aef6217b5b5890eb3b45a721f
4
- data.tar.gz: 89ceffa2c42fe78bcd7e001658f14a54a5a0a627
3
+ metadata.gz: b5a04f37290c238dda1763d8a9df4a0a858def89
4
+ data.tar.gz: 3afb2e8848f66d1ac4807808ab7981fea0ae4ac0
5
5
  SHA512:
6
- metadata.gz: 297be132095c971412a09434c5f2ddfa109f081891c5211e648eb3380c593ccc79cf65d0a589c1089abb76c2b3cbdf9360205e2d719d608dd2a5135d9ccfdd65
7
- data.tar.gz: 08f5d7925c6168e22b908a641775ec06e3d538ab8fba94774afefba43feb037b863cd5d07f21101b853252c586c50cacd280d8dc8323179d64db714a9f1aa933
6
+ metadata.gz: 7fb26870f5d89b03ebb5f06870fda36f8db2d05d76e9ff9f9ca535ba661d0f11824b3797bf60e3c0102e7fe1e0ef8ed5363c08e76761dbbeaf159aed54e9dadf
7
+ data.tar.gz: 0af553ebbef75f2fe4faa3efc70a7e68ebf9a7916548e3cc6ce7f3c5cfae2da23db96323a5f7d84c3a6942b73d59919083afc09b7fbab43fd65d08c60494d5da
@@ -90,6 +90,8 @@ module Latinum
90
90
  end
91
91
 
92
92
  def <=> other
93
+ return nil unless other and other.is_a? self.class
94
+
93
95
  if @name == other.name
94
96
  @amount <=> other.amount
95
97
  else
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Latinum
22
- VERSION = "0.5.5"
22
+ VERSION = "0.5.6"
23
23
  end
@@ -72,5 +72,14 @@ module Latinum::ResourceSpec
72
72
 
73
73
  expect(original_price / 2.0).to be == Latinum::Resource.load("5 NZD")
74
74
  end
75
+
76
+ it "should compare with nil" do
77
+ a = Latinum::Resource.load("10 NZD")
78
+
79
+ expect{a <=> nil}.to_not raise_exception
80
+ expect{a == nil}.to_not raise_exception
81
+ expect(a <=> nil).to be == nil
82
+ expect(a == nil).to be == false
83
+ end
75
84
  end
76
85
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: latinum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-18 00:00:00.000000000 Z
11
+ date: 2015-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler