wowecon 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,12 @@ module Wowecon
16
16
  output += "#{value.to_s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,")}#{denom.to_s[0,1]} "
17
17
  end
18
18
  end
19
- output.strip
19
+
20
+ if output == ""
21
+ "no price"
22
+ else
23
+ output.strip
24
+ end
20
25
  end
21
26
 
22
27
  def to_html
@@ -26,7 +26,7 @@ describe Wowecon::Currency do
26
26
 
27
27
  it "returns a currency value of zero if initialised with an invalid hash" do
28
28
  zero = Wowecon::Currency.new({:error => "price not found"})
29
- zero.to_f.should == 0 && zero.to_hash.should == {:gold => 0, :silver => 0, :copper => 0}
29
+ zero.to_s.should == "no price" && zero.to_f.should == 0 && zero.to_hash.should == {:gold => 0, :silver => 0, :copper => 0}
30
30
  end
31
31
 
32
32
  it "can create a string representation of the currency value" do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wowecon
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ben Darlow