Sha256: 2202592297f10e6db30d85b045d96a5d800864f309fce9af2f0c6b2ac5aabeb0

Contents?: true

Size: 736 Bytes

Versions: 6

Compression:

Stored size: 736 Bytes

Contents

$: << File.expand_path('..', __FILE__)
require 'ridgepole'
require 'string_ext'

ActiveRecord::Migration.verbose = false
Ridgepole::Logger.instance.level = ::Logger::ERROR

RSpec.configure do |config|
  config.before(:each) do
    restore_database
  end
end

def restore_database
  sql_file = File.expand_path('../ridgepole_test_database.sql', __FILE__)
  system("mysql -uroot < #{sql_file}")
end

def restore_tables
  sql_file = File.expand_path('../ridgepole_test_tables.sql', __FILE__)
  system("mysql -uroot < #{sql_file}")
end

def client(options = {}, config = {})
  config = {
    adapter: 'mysql2',
    database: 'ridgepole_test',
  }.merge(config)

  options = {
  }.merge(options)

  Ridgepole::Client.new(config, options)
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ridgepole-0.2.1 spec/spec_helper.rb
ridgepole-0.2.0 spec/spec_helper.rb
ridgepole-0.1.9 spec/spec_helper.rb
ridgepole-0.1.8 spec/spec_helper.rb
ridgepole-0.1.7 spec/spec_helper.rb
ridgepole-0.1.6 spec/spec_helper.rb