Sha256: 3a18555c2200272be94a81c7acc4b2d9481133f5bcb529e2f31284512a7ad969

Contents?: true

Size: 441 Bytes

Versions: 2

Compression:

Stored size: 441 Bytes

Contents

require "spec_helper"


describe Membrane::Schema::Bool do
  describe "#validate" do
    let(:schema) { Membrane::Schema::Bool.new }

    it "should return nil for {true, false}" do
      [true, false].each { |v| schema.validate(v).should be_nil }
    end

    it "should return an error for values not in {true, false}" do
      ["a", 1].each do |v|
        expect_validation_failure(schema, v, /true or false/)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
membrane-0.0.2 spec/bool_schema_spec.rb
membrane-0.0.1 spec/bool_schema_spec.rb