bitstamp-2 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bitstamp.gemspec +1 -1
- data/lib/bitstamp/orders.rb +1 -1
- data/spec/orders_spec.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bd43f1e1aec7becfe4ebe4c8a3413df6029c1b4
|
4
|
+
data.tar.gz: 4f6e67757fd35fcdf9927f4cd70de30996c43b6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7534c7d965f05ad4fd1a5862896f5b8f0aa14fc9b1c0b7d655b461ce506aae01267f727b67827be0ce217eb4e58a1472cc1da1bb03ac11b3b6c43d1b2a614345
|
7
|
+
data.tar.gz: ce927331dc9418a41444b824a495e6fd8a0817591303d67af119809dab5cea99d808e64b77a486e4f0fc526677ea5ed9264a46d699539507b7aa6cbdf20e3043
|
data/Gemfile.lock
CHANGED
data/bitstamp.gemspec
CHANGED
data/lib/bitstamp/orders.rb
CHANGED
data/spec/orders_spec.rb
CHANGED
@@ -26,8 +26,6 @@ describe Bitstamp::Orders do
|
|
26
26
|
describe 'market orders' do
|
27
27
|
before do
|
28
28
|
VCR.turn_off!
|
29
|
-
stub_request(:post, "https://www.bitstamp.net/api/v2/buy/market/btcusd/")
|
30
|
-
.to_return(status: 200, body: fixture('successful_order_bitstamp.json'), headers: { 'Content-Type' => 'application/json' })
|
31
29
|
end
|
32
30
|
|
33
31
|
after do
|
@@ -35,10 +33,21 @@ describe Bitstamp::Orders do
|
|
35
33
|
end
|
36
34
|
|
37
35
|
it 'is successfully executed' do
|
36
|
+
stub_request(:post, "https://www.bitstamp.net/api/v2/buy/market/btcusd/")
|
37
|
+
.to_return(status: 200, body: fixture('successful_order_bitstamp.json'), headers: { 'Content-Type' => 'application/json' })
|
38
38
|
executed_order = Bitstamp.orders.market_buy(:amount => 1, :price => 1000)
|
39
39
|
expect(executed_order).to be_kind_of Bitstamp::Order
|
40
40
|
expect(executed_order.price).to eq "1.25"
|
41
41
|
end
|
42
|
+
|
43
|
+
it 'throws an error' do
|
44
|
+
stub_request(:post, "https://www.bitstamp.net/api/v2/buy/market/btcusd/")
|
45
|
+
.to_return(status: 200, body: fixture('market_order_error.json'), headers: { 'Content-Type' => 'application/json' })
|
46
|
+
executed_order = Bitstamp.orders.market_buy(:amount => 1, :price => 1000)
|
47
|
+
expect(executed_order.price).to be_nil
|
48
|
+
expect(executed_order.reason).not_to be_nil
|
49
|
+
expect(executed_order.status).to eq 'error'
|
50
|
+
end
|
42
51
|
end
|
43
52
|
|
44
53
|
describe :buy, vcr: {cassette_name: 'bitstamp/orders/buy'} do
|