Sha256: 2c36ed2308e1d82243359b6d9c2191cd52214ba29e5e5799911ee8f9a336f5c7

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

# encoding: utf-8

if ENV['COVERAGE'] == 'true'
  require 'simplecov'
  require 'coveralls'

  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
    SimpleCov::Formatter::HTMLFormatter,
    Coveralls::SimpleCov::Formatter
  ]

  SimpleCov.start do
    command_name 'spec:unit'

    add_filter 'config'
    add_filter 'lib/rom/support'
    add_filter 'spec'
  end
end

class BasicObject
  def self.freeze
    # FIXME: remove this when axiom no longer freezes classes
  end
end

require 'devtools/spec_helper'

require 'rom-session'

require 'axiom'
require 'rom-relation'
require 'rom-mapper'
require 'rom/support/axiom/adapter/memory'

require 'bogus/rspec'

include ROM

def mock_model(*attributes)
  Class.new {
    include Equalizer.new(*attributes)

    attributes.each { |attribute| attr_accessor attribute }

    def initialize(attrs = {})
      attrs.each { |name, value| send("#{name}=", value) }
    end
  }
end

TEST_ENV = Environment.setup(test: 'memory://test')

TEST_ENV.schema do
  base_relation :users do
    repository :test

    attribute :id,   Integer
    attribute :name, String

    key :id
  end
end

TEST_ENV.mapping do
  users do
    model mock_model(:id, :name)
    map :id, :name
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rom-session-0.1.1 spec/spec_helper.rb
rom-session-0.1.0 spec/spec_helper.rb