Sha256: a67bb3f57dc271e44d55afb9ff74ab7b3d2ee027a76730a6765303bff93f3dd5

Contents?: true

Size: 789 Bytes

Versions: 6

Compression:

Stored size: 789 Bytes

Contents

# frozen_string_literal: true

require 'rspec'
begin
  require 'active_model'
rescue LoadError
  puts 'Running specs without active_model extension'
end

require "#{File.dirname(__FILE__)}/../lib/valvat.rb"

RSpec.configure do |config|
  config.mock_with :rspec
  config.filter_run focus: true
  config.run_all_when_everything_filtered = true
  config.backtrace_exclusion_patterns = [%r{rspec/(core|expectations)}]
end

I18n.enforce_available_locales = false if defined?(I18n)

if defined?(ActiveModel)
  class ModelBase
    include ActiveModel::Serialization
    include ActiveModel::Validations

    attr_accessor :attributes

    def initialize(attributes = {})
      @attributes = attributes
    end

    def read_attribute_for_validation(key)
      @attributes[key]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
valvat-1.1.5 spec/spec_helper.rb
valvat-1.1.4 spec/spec_helper.rb
valvat-1.1.3 spec/spec_helper.rb
valvat-1.1.2 spec/spec_helper.rb
valvat-1.1.1 spec/spec_helper.rb
valvat-1.1.0 spec/spec_helper.rb