Sha256: 3b80492e75593a055c6c6148f26e9897be784584820f8fa683c7eeef05405869

Contents?: true

Size: 537 Bytes

Versions: 1

Compression:

Stored size: 537 Bytes

Contents

require 'rspec'
require 'active_model'
require 'active_record'
require 'mask_validator'

require "support/db/schema"
require "support/models/person"

RSpec::Matchers.define :have_valid_value_to do |attribute|
  match do |actual|
    actual.valid?

    !actual.errors[attribute].include?("is invalid")
  end

  failure_message_for_should do |actual|
    "expected that the #{attribute} attribute would be valid"
  end

  failure_message_for_should_not do |actual|
    "expected that the #{attribute} attribute would be invalid"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mask_validator-0.2.1 spec/spec_helper.rb