crazy_money 1.1.0 → 1.1.1

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: 22d4abd4ba8e797bdeabcd5602fce74b682e9b0f
4
- data.tar.gz: 1a3ce939ff808b0ad91e8cb9c412aed640614b19
3
+ metadata.gz: 12d32e285aa7e2ce6a53feee1d214718ad5df46d
4
+ data.tar.gz: fcaa7be42922ae7fc23b1143cfdb4b496edf05ab
5
5
  SHA512:
6
- metadata.gz: 8a76c26c72031391eb8bc928d203871e5c449b9c8af45066cb085d628b6f0533b340ab499630a96affb096dc52f0e36eba45110a6016582e1f04c726c2475a86
7
- data.tar.gz: 9ccf86a03aee3de9717fe66e1b92035e5c9236fc2dc4bb988749ad48cb0d195aa8cda7cd959e199b8d4b8dc569d61531560c1c6536e4be1684d30f9d9c0b52a1
6
+ metadata.gz: cce29b0c6b9ebae13e85ffefc8ed7b10cb290b4934895397ec054199672b221a0a95ccf997157146bd273061667d379d764e25c37ca3b97b4a57eee01ad1ef71
7
+ data.tar.gz: 8c492358bd8c5e5fb0e223d1671800aa440d12d902f6899c437cd3427e7b6c9879c2f200c33d98cf3b2392d37cdf46b3a33cfa15cda0f8736ea3461302149866
@@ -2,7 +2,7 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.0
5
+ - 2.1
6
6
  notifications:
7
7
  email:
8
8
  on_success: always
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "crazy_money"
7
- spec.version = "1.1.0"
7
+ spec.version = "1.1.1"
8
8
  spec.authors = ["Cédric Félizard"]
9
9
  spec.email = ["cedric@felizard.fr"]
10
10
  spec.description = %q{Simple money wrapper}
@@ -16,6 +16,10 @@ class CrazyMoney
16
16
  sprintf("%.2f", @amount)
17
17
  end
18
18
 
19
+ def inspect
20
+ "#<CrazyMoney amount=#{to_s}>"
21
+ end
22
+
19
23
  def == other
20
24
  @amount == BigDecimal.new(other.to_s)
21
25
  end
@@ -17,11 +17,16 @@ describe CrazyMoney do
17
17
  specify { expect(CrazyMoney.new(one_third).to_s).to eq("0.33") }
18
18
  end
19
19
 
20
+ describe "#inspect" do
21
+ specify { expect(CrazyMoney.new(0).inspect).to eq("#<CrazyMoney amount=0.00>") }
22
+ specify { expect(CrazyMoney.new("-13.37").inspect).to eq("#<CrazyMoney amount=-13.37>") }
23
+ end
24
+
20
25
  describe "#==" do
21
- specify { expect(CrazyMoney.new(0) == 0).to be_true }
22
- specify { expect(CrazyMoney.new(one_third) == one_third).to be_true }
23
- specify { expect(CrazyMoney.new("1.23456789") == 1.23456789).to be_true }
24
- specify { expect(CrazyMoney.new(1.23456789) == 1.23456789).to be_true }
26
+ specify { expect(CrazyMoney.new(0) == 0).to be true }
27
+ specify { expect(CrazyMoney.new(one_third) == one_third).to be true }
28
+ specify { expect(CrazyMoney.new("1.23456789") == 1.23456789).to be true }
29
+ specify { expect(CrazyMoney.new(1.23456789) == 1.23456789).to be true }
25
30
  end
26
31
 
27
32
  describe "arithmetic operations" do
@@ -88,8 +93,8 @@ describe CrazyMoney do
88
93
  end
89
94
 
90
95
  describe "comparison" do
91
- specify { expect(CrazyMoney.new(10) > 0).to be_true }
92
- specify { expect(CrazyMoney.new(10) > CrazyMoney.new(0)).to be_true }
96
+ specify { expect(CrazyMoney.new(10) > 0).to be true }
97
+ specify { expect(CrazyMoney.new(10) > CrazyMoney.new(0)).to be true }
93
98
 
94
99
  specify { expect([0, CrazyMoney.new(10)].max).to eq(10) }
95
100
  specify { expect([CrazyMoney.new(0), CrazyMoney.new(10)].max).to eq(10) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crazy_money
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cédric Félizard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-24 00:00:00.000000000 Z
11
+ date: 2014-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: currency_data
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 2.2.0
106
+ rubygems_version: 2.2.2
107
107
  signing_key:
108
108
  specification_version: 4
109
109
  summary: Crazy Money