bitstampede 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ *.sw*
@@ -46,6 +46,7 @@ module Bitstampede
46
46
 
47
47
  def check_for_errors(hash)
48
48
  if hash.has_key?("error")
49
+ raise Bitstampede::StandardError.new(hash["error"]) if hash["error"].is_a?(String)
49
50
  if hash["error"].has_key?("__all__")
50
51
  raise Bitstampede::StandardError.new(hash["error"]["__all__"].join(". "))
51
52
  else
@@ -1,3 +1,3 @@
1
1
  module Bitstampede
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -64,5 +64,18 @@ describe Bitstampede::Entities::Order do
64
64
  expect{ subject }.to raise_error(Bitstampede::StandardError, "Bitstamp API Error #404")
65
65
  end
66
66
  end
67
+
68
+ context "given invalid BitStamp credentials" do
69
+ let(:order_hash){
70
+ # Don't get mad at me, not my fault bitstamp errors look like this, and are not in a consistant pattern
71
+ {
72
+ "error" => "Invalid username and/or password"
73
+ }
74
+ }
75
+
76
+ it "raises an appropriate error" do
77
+ expect{ subject }.to raise_error(Bitstampede::StandardError, "Invalid username and/or password")
78
+ end
79
+ end
67
80
  end
68
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitstampede
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-11 00:00:00.000000000 Z
12
+ date: 2013-08-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: net-http-persistent
@@ -191,7 +191,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
191
  version: '0'
192
192
  segments:
193
193
  - 0
194
- hash: -2131896050803578099
194
+ hash: -3274476423470274657
195
195
  required_rubygems_version: !ruby/object:Gem::Requirement
196
196
  none: false
197
197
  requirements:
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  segments:
202
202
  - 0
203
- hash: -2131896050803578099
203
+ hash: -3274476423470274657
204
204
  requirements: []
205
205
  rubyforge_project:
206
206
  rubygems_version: 1.8.25