Sha256: b248579ea23a0b00a7e90fb606707d5a365e81d1a93a434ec814c40c830e5eb6
Contents?: true
Size: 1.84 KB
Versions: 4
Compression:
Stored size: 1.84 KB
Contents
require 'spec_helper' module BitWallet describe Wallet, vcr: {record: :once}, bitcoin_cleaner: true do describe '#accounts' do it 'should return array of BitWallet::Accounts' do wallet = build(:wallet) wallet.accounts.should be_kind_of(Accounts) end end describe '#recent_transactions' do it 'should return the most recent transactions of all accounts defaulting to 10 transactions' do wallet = build(:wallet) default_account = wallet.accounts.new('') account_1 = wallet.accounts.new('1') 1.upto(11).each do |n| default_account.send_amount 0.1, to: account_1.addresses.first end wallet.recent_transactions.size.should == 10 end it 'should allow overriding of the transaction limit' do wallet = build(:wallet) default_account = wallet.accounts.new('') account_1 = wallet.accounts.new('1') 1.upto(11).each do |n| default_account.send_amount 0.1, to: account_1.addresses.first end wallet.recent_transactions(limit: 5).size.should == 5 end end describe '#move' do it 'should move funds from one account to another' do wallet = build(:wallet) default_account = wallet.accounts.new('') account_1 = wallet.accounts.new('1') wallet.move '', '1', 1.1 wallet.move default_account, account_1, 0.5 account_1.balance.should == 1.6 end end describe "#client" do it "returns the client created by InstantiatesBitcoinClient" do client = double config = {some: "config"} allow(InstantiatesBitcoinClient). to receive(:execute).with(config). and_return(client) wallet = described_class.new(config) expect(wallet.client).to eq(client) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems