Sha256: bd684e2465587904d272b765e6c1ec245dd76d4740801d9a6cd433fbd93fe743

Contents?: true

Size: 1.18 KB

Versions: 4

Compression:

Stored size: 1.18 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Bitbank" do
  describe 'initialization' do
    it 'should configure the client' do
      client = Bitbank.new(:username => 'prefect', :password => 'hoopy')
      client.is_a?(Bitbank::Client).should be_true
    end
  end

  describe 'configuration' do
    it 'should require a username and password' do
      expect {
        Bitbank.config = { :username => 'marvin' }
      }.to raise_error(ArgumentError, 'Please specify a username and password for bitcoind')
    end

    it 'should parse a yaml file for credentials' do
      Bitbank.config = File.join(File.dirname(__FILE__), '..', 'config.yml')
      Bitbank.config[:username].should == 'testuser'
      Bitbank.config[:password].should == 'testpass'
    end

    it 'should use default values' do
      Bitbank.config = File.join(File.dirname(__FILE__), '..', 'config.yml')
      Bitbank.config[:host].should == 'localhost'
      Bitbank.config[:port].should == 8332
    end
  end

  describe 'version' do
    it 'should read version from file' do
      Bitbank.version.should == File.read(
        File.join(File.dirname(__FILE__), '..', 'VERSION')).chomp
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bitbank-0.1.2 spec/bitbank_spec.rb
bitbank-0.1.1 spec/bitbank_spec.rb
bitbank-0.1.0 spec/bitbank_spec.rb
bitbank-0.0.1 spec/bitbank_spec.rb