require 'spec_helper' describe DocTag do SchemaTools.schema_path = DocTag::Schema.path before :all do @schemata = SchemaTools::Reader.read_all end context 'class creation' do it 'should init all classes' do DocTag.init @schemata.each do |schema| klass = schema['name'].classify DocTag.const_defined?(klass).should be_true DocTag.const_get(klass).new end end it 'should with params' do DocTag.init DocTag::Document.new number: '4711' end it 'should validate' do DocTag.init doc = DocTag::Document.new number: '4711' doc.valid? doc.errors.full_messages.should be_present end end end