Sha256: 6adf4ec3b35db7f77967af56bf3005229c46f092692015d49ca1696ea3a57d4e
Contents?: true
Size: 643 Bytes
Versions: 5
Compression:
Stored size: 643 Bytes
Contents
require "minitest_helper" module Hermod module Validators describe NonZero do subject do NonZero.new end it "allows positive values" do expect(subject.valid?(1, {})).must_equal true end it "allows negative values" do expect(subject.valid?(-1, {})).must_equal true end it "allows blank values" do expect(subject.valid?(nil, {})).must_equal true end it "raises an error for zero values" do ex = expect { subject.valid?(0, {}) }.must_raise InvalidInputError expect(ex.message).must_equal "cannot be zero" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems