Sha256: 98e189fc1cd0c1c8b37519b5cb478660ca7490bacf44ce7756353ddb24f66dd4

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

require_relative 'test_helper'

kraken = KrakenClient.load
client = kraken.public

# Server Time
VCR.use_cassette("server_time") do
  kraken_time = DateTime.parse(client.server_time.rfc1123)
  utc_time = Time.now.getutc
  Spectus.this { kraken_time.day.class }.MUST Equal: Fixnum
  Spectus.this { kraken_time.hour.class }.MUST Equal: Fixnum
end

# Assets
VCR.use_cassette("assets") do
  Spectus.this { client.assets.XETH.aclass }.MUST Eql: 'currency'
end

# Assets Pairs
VCR.use_cassette("assets_pairs") do
  Spectus.this { client.asset_pairs.XETHXXBT.altname }.MUST Eql: 'ETHXBT'
end

# Ticker
VCR.use_cassette("ticker") do
  result = client.ticker(pair: 'XXBTZEUR, XXBTZGBP')
  Spectus.this { result.XXBTZGBP.a.class }.MUST Equal: Array
end

# Order Book
VCR.use_cassette("order_book") do
  order_book = client.order_book(pair: 'XXBTZEUR')
  Spectus.this { order_book.XXBTZEUR.asks.class }.MUST Equal: Array
end

# Trades
VCR.use_cassette("trades") do
  trades = client.trades(pair: 'XXBTZEUR')
  Spectus.this { trades.XXBTZEUR.class }.MUST Equal: Array
end

# Spread
VCR.use_cassette("spread") do
  spread = client.spread(pair: 'XXBTZEUR')
  Spectus.this { spread.XXBTZEUR.class }.MUST Equal: Array
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kraken_client-1.1.0 test/test_public.rb
kraken_client-1.0.3 test/test_public.rb
kraken_client-1.0.2 test/test_public.rb
kraken_client-1.0.1 test/test_public.rb
kraken_client-1.0.0 test/test_public.rb
kraken_client-0.2.1 test/test_public.rb