Sha256: 7bef2419353f30f5d2a2e9858553d1532efb0e6ab7817c39b3718c8f3cac2211

Contents?: true

Size: 1.58 KB

Versions: 5

Compression:

Stored size: 1.58 KB

Contents

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require 'coveralls'
Coveralls.wear!
require "ap"
require "bundler"
require "sandthorn_driver_sequel"
require "support/custom_matchers"

Bundler.require

module Helpers
  def class_including(mod)
    Class.new.tap {|c| c.send :include, mod }
  end
end

RSpec.configure do |config|
  config.run_all_when_everything_filtered = true
  config.filter_run :focus
  config.filter_run_excluding benchmark: true

  # Run specs in random order to surface order dependencies. If you find an
  # order dependency and want to debug it, you can fix the order by providing
  # the seed, which is printed after each run.
  #     --seed 1234
  config.order = 'random'
  config.before(:each) { sqlite_store_setup }
end

def spec_db
  "sqlite://spec/db/sequel_driver.sqlite3"
end
def sqlite_store_setup
  url = spec_db 
  driver = SandthornDriverSequel.driver_from_url(url: url)
  Sandthorn.configure do |c|
    c.event_store = driver
    c.serializer = Proc.new { |data| YAML::dump(data) }
    c.deserializer = Proc.new { |data| YAML::load(data) }
    c.snapshot_serializer = Proc.new { |data| YAML::dump(data) }
    c.snapshot_deserializer = Proc.new { |data| YAML::load(data) }
  end
  migrator = SandthornDriverSequel::Migration.new url: url
  SandthornDriverSequel.migrate_db url: url
  migrator.send(:clear_for_test)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sandthorn-0.9.2 spec/spec_helper.rb
sandthorn-0.9.1 spec/spec_helper.rb
sandthorn-0.9.0 spec/spec_helper.rb
sandthorn-0.8.1 spec/spec_helper.rb
sandthorn-0.8.0 spec/spec_helper.rb