Sha256: ebf845969999156c2cd63e7650fab24bd4204c9009ed6f19841a6dce8f0ad671

Contents?: true

Size: 838 Bytes

Versions: 1

Compression:

Stored size: 838 Bytes

Contents

libs = %w[
  active_model
  active_support/core_ext
  pry
  rspec
  validation_matcher
]

libs.each { |lib| require lib }

RSpec.configure do |config|
  Kernel.srand config.seed

  config.filter_run :focus
  config.order = :random
  config.run_all_when_everything_filtered = true

  config.expect_with :rspec do |expectations|
    expectations.include_chain_clauses_in_custom_matcher_descriptions = true
    expectations.syntax = :should
  end

  config.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
    mocks.syntax = :should
  end
end

class Thing

  extend  ActiveModel::Naming
  include ActiveModel::Conversion
  include ActiveModel::Validations

  attr_accessor :field_a, :field_b, :field_c

  validates :field_b, presence: true
  validates :field_c, numericality: { allow_nil: false, only_integer: true }

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validation_matcher-3.1.0 spec/spec_helper.rb