Sha256: f312c98a04a9eba1c912f0c9f9e275c632c723bc34eea68b01ad520eec9f535a

Contents?: true

Size: 1.22 KB

Versions: 7

Compression:

Stored size: 1.22 KB

Contents

require 'bundler'
Bundler.setup

begin
  require 'coveralls'
  Coveralls.wear!
rescue LoadError
end

require 'with_model'
RSpec.configure do |config|
  config.extend WithModel

  config.warnings = true

  config.expect_with :rspec do |c|
    c.syntax = :expect
  end

  config.mock_with :rspec do |c|
    c.syntax = :expect
  end
end

is_jruby = RUBY_PLATFORM =~ /\bjava\b/
adapter = is_jruby ? 'jdbcsqlite3' : 'sqlite3'

# WithModel requires ActiveRecord::Base.connection to be established.
# If ActiveRecord already has a connection, as in a Rails app, this is unnecessary.
require 'active_record'
ActiveRecord::Base.establish_connection(:adapter => adapter, :database => ':memory:')

if defined?(I18n) && I18n.respond_to?(:enforce_available_locales=)
  I18n.enforce_available_locales = true
end

if ENV['LOGGER']
  require 'logger'
  ActiveRecord::Base.logger = Logger.new($stdout)
end

module SpecHelper
  module RailsTestCompatability
    if ::ActiveRecord::VERSION::STRING >= '4.1.0'
      require 'minitest'
      include Minitest::Assertions
      def assertions; @assertions ||= 0; end
      def assertions= value; @assertions = value; end
    else
      require 'test/unit/assertions'
      include Test::Unit::Assertions
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
with_model-2.0.0 spec/spec_helper.rb
with_model-1.2.2 spec/spec_helper.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/with_model-1.2.1/spec/spec_helper.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/with_model-1.2.1/spec/spec_helper.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/with_model-1.2.1/spec/spec_helper.rb
with_model-1.2.1 spec/spec_helper.rb
with_model-1.2.0 spec/spec_helper.rb