Sha256: 4747d0ea1ccfc7315c81fddfeea0fb2ffe17f4c49e7e9b305c45aabc28755d5e

Contents?: true

Size: 473 Bytes

Versions: 1

Compression:

Stored size: 473 Bytes

Contents

require 'spec_helper'

describe Valcro::Runner do
  it 'can store validators' do
    runner = Valcro::Runner.new
    runner.add_validator :some_validator
    expect(runner.validators).to have(1).validator
  end

  it 'runs validators' do
    error_list = Valcro::ErrorList.new
    runner     = Valcro::Runner.new(error_list)
    runner.add_validator lambda { |errors| errors.add :foo, 'Huge mistake' }

    runner.validate

    expect(error_list.any?).to be_true
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
valcro-0.1 spec/runner_spec.rb