chaintope / bitcoinrb

The implementation of the bitcoin protocol for ruby.
MIT License
61 stars 19 forks source link

Spec for wallet.rb fails. #11

Closed Yamaguchi closed 6 years ago

Yamaguchi commented 6 years ago
$ bundle exec rspec ./spec/bitcoin/wallet/wallet_spec.rb 

Bitcoin::Wallet
  #load
    existing wallet
      should return wallet (FAILED - 1)
    dose not exist wallet
      should raise error (FAILED - 2)
  #create
    should create new wallet
      should be create (FAILED - 3)
    same wallet_id already exist
      should raise error (FAILED - 4)
  #wallets_path
    should return wallet dir. (FAILED - 5)
  #create_account
    should be created (FAILED - 6)

Failures:

  1) Bitcoin::Wallet#load existing wallet should return wallet
     Got 0 failures and 2 other errors:

     1.1) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:11:in `block (4 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:13:in `block (4 levels) in <top (required)>'

     1.2) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:6:in `block (2 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:7:in `block (2 levels) in <top (required)>'

  2) Bitcoin::Wallet#load dose not exist wallet should raise error
     Got 0 failures and 2 other errors:

     2.1) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:20:in `new'
          # ./lib/bitcoin/wallet/base.rb:20:in `create'
          # ./spec/spec_helper.rb:54:in `create_test_wallet'
          # ./spec/bitcoin/wallet/wallet_spec.rb:5:in `block (2 levels) in <top (required)>'

     2.2) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:6:in `block (2 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:7:in `block (2 levels) in <top (required)>'

  3) Bitcoin::Wallet#create should create new wallet should be create
     Got 0 failures and 2 other errors:

     3.1) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:20:in `new'
          # ./lib/bitcoin/wallet/base.rb:20:in `create'
          # ./spec/spec_helper.rb:54:in `create_test_wallet'
          # ./spec/bitcoin/wallet/wallet_spec.rb:5:in `block (2 levels) in <top (required)>'

     3.2) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:6:in `block (2 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:7:in `block (2 levels) in <top (required)>'

  4) Bitcoin::Wallet#create same wallet_id already exist should raise error
     Got 0 failures and 2 other errors:

     4.1) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:20:in `new'
          # ./lib/bitcoin/wallet/base.rb:20:in `create'
          # ./spec/spec_helper.rb:54:in `create_test_wallet'
          # ./spec/bitcoin/wallet/wallet_spec.rb:5:in `block (2 levels) in <top (required)>'

     4.2) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:6:in `block (2 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:7:in `block (2 levels) in <top (required)>'

  5) Bitcoin::Wallet#wallets_path should return wallet dir.
     Got 0 failures and 2 other errors:

     5.1) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:20:in `new'
          # ./lib/bitcoin/wallet/base.rb:20:in `create'
          # ./spec/spec_helper.rb:54:in `create_test_wallet'
          # ./spec/bitcoin/wallet/wallet_spec.rb:5:in `block (2 levels) in <top (required)>'

     5.2) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:6:in `block (2 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:7:in `block (2 levels) in <top (required)>'

  6) Bitcoin::Wallet#create_account should be created
     Got 0 failures and 2 other errors:

     6.1) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:20:in `new'
          # ./lib/bitcoin/wallet/base.rb:20:in `create'
          # ./spec/spec_helper.rb:54:in `create_test_wallet'
          # ./spec/bitcoin/wallet/wallet_spec.rb:5:in `block (2 levels) in <top (required)>'

     6.2) Failure/Error: @level_db = ::LevelDB::DB.new(path)

          LevelDB::Error:
            IO error: lock /var/folders/gl/_0rgn1fd3tq54qlrq8rfkfw00000gp/T/wallet/wallet1//LOCK: already held by process
          # ./lib/bitcoin/wallet/db.rb:16:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:85:in `new'
          # ./lib/bitcoin/wallet/base.rb:85:in `initialize'
          # ./lib/bitcoin/wallet/base.rb:33:in `new'
          # ./lib/bitcoin/wallet/base.rb:33:in `load'
          # ./spec/bitcoin/wallet/wallet_spec.rb:6:in `block (2 levels) in <top (required)>'
          # ./spec/bitcoin/wallet/wallet_spec.rb:7:in `block (2 levels) in <top (required)>'

Finished in 0.04242 seconds (files took 0.29127 seconds to load)
6 examples, 6 failures

Failed examples:

rspec ./spec/bitcoin/wallet/wallet_spec.rb:12 # Bitcoin::Wallet#load existing wallet should return wallet
rspec ./spec/bitcoin/wallet/wallet_spec.rb:19 # Bitcoin::Wallet#load dose not exist wallet should raise error
rspec ./spec/bitcoin/wallet/wallet_spec.rb:28 # Bitcoin::Wallet#create should create new wallet should be create
rspec ./spec/bitcoin/wallet/wallet_spec.rb:39 # Bitcoin::Wallet#create same wallet_id already exist should raise error
rspec ./spec/bitcoin/wallet/wallet_spec.rb:47 # Bitcoin::Wallet#wallets_path should return wallet dir.
rspec ./spec/bitcoin/wallet/wallet_spec.rb:57 # Bitcoin::Wallet#create_account should be created