Sha256: df97838457aa875f4fc29a33a4837e2dda9ecd7acafb106cf80bd3d2a15de355

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

require 'rubygems'
require 'yaml'
require 'json'
require 'satoshi-unit'
require 'sequel'
require 'sentry-raven'
Sequel.extension :migration

db_file = File.dirname(__FILE__) + "/config/txcatcher_test.db"
File.delete(db_file) if File.exists?(db_file)

require_relative '../lib/txcatcher/logger'
require_relative '../lib/txcatcher/utils/hash_string_to_sym_keys'
require_relative '../lib/txcatcher/config'
require_relative '../lib/txcatcher/initializer'
require_relative '../lib/txcatcher/bitcoin_rpc'

include TxCatcher::Initializer
ConfigFile.set!(File.dirname(__FILE__) + "/config/config.yml")

read_config_file
initialize_sentry
connect_to_db
run_migrations if migrations_pending?
connect_to_rpc_node

require_relative '../lib/txcatcher/models/transaction'
require_relative '../lib/txcatcher/models/address'
require_relative '../lib/txcatcher/models/deposit'

def unhexlify(msg)
  msg.scan(/../).collect { |c| c.to_i(16).chr }.join
end 

RSpec.configure do |config|

  LOGFILE = File.expand_path(File.dirname(__FILE__) + "/config/txcatcher.log")
  ERRFILE = File.expand_path(File.dirname(__FILE__) + "/config/error.log")

  config.default_formatter = 'doc'
  config.before(:all) do
  end

  config.after(:all) do
  end

  config.before(:each) do
    TxCatcher::Transaction.select_all.delete
    TxCatcher::Deposit.select_all.delete
    TxCatcher::Address.select_all.delete
  end

  config.after(:each) do
    [LOGFILE, ERRFILE].each do |f|
      FileUtils.rm(f) if File.exist?(f)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
txcatcher-0.1.82 spec/spec_helper.rb
txcatcher-0.1.81 spec/spec_helper.rb
txcatcher-0.1.80 spec/spec_helper.rb