Sha256: 4338a0d43c7c3142e63631d690a9de3c3c9a06fa2c2f6c0b60be3d57733bd428

Contents?: true

Size: 562 Bytes

Versions: 2

Compression:

Stored size: 562 Bytes

Contents

require "spec_helper"

describe Membrane::Schema::Enum do
  describe "#validate" do
    let (:int_schema) { Membrane::Schema::Class.new(Integer) }
    let (:str_schema) { Membrane::Schema::Class.new(String) }
    let (:enum_schema) { Membrane::Schema::Enum.new(int_schema, str_schema) }

    it "should return an error if none of the schemas validate" do
      expect_validation_failure(enum_schema, :sym, /doesn't validate/)
    end

    it "should return nil if any of the schemas validate" do
      enum_schema.validate("foo").should be_nil
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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