Sha256: 84284b63a7681bcfce998cd329cf963808400f9e6190bf95ecb5d8d17f205fc8

Contents?: true

Size: 472 Bytes

Versions: 20

Compression:

Stored size: 472 Bytes

Contents

require "minitest_helper"

module Hermod
  module Validators
    describe ValuePresence do
      subject do
        ValuePresence.new
      end

      it "allows values that are present" do
        subject.valid?(1, {}).must_equal true
      end

      it "raises an error for missing values" do
        ex = proc { subject.valid?(nil, {}) }.must_raise InvalidInputError
        ex.message.must_equal "isn't optional but no value was provided"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
hermod-2.6.2 spec/hermod/validators/value_presence_spec.rb
hermod-2.6.1 spec/hermod/validators/value_presence_spec.rb
hermod-2.5.3 spec/hermod/validators/value_presence_spec.rb
hermod-2.5.2 spec/hermod/validators/value_presence_spec.rb
hermod-2.5.1 spec/hermod/validators/value_presence_spec.rb
hermod-2.5.0 spec/hermod/validators/value_presence_spec.rb
hermod-2.4.1 spec/hermod/validators/value_presence_spec.rb
hermod-2.4.0 spec/hermod/validators/value_presence_spec.rb
hermod-2.2.0 spec/hermod/validators/value_presence_spec.rb
hermod-2.1.0 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.9 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.8 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.7 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.6 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.5 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.4 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.3 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.2 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.1 spec/hermod/validators/value_presence_spec.rb
hermod-1.2.0 spec/hermod/validators/value_presence_spec.rb