spec/spec_helper.rb in mongoa-0.1.12 vs spec/spec_helper.rb in mongoa-0.1.13
- old
+ new
@@ -13,11 +13,39 @@
MongoMapper.connect("test")
require 'rspec'
Rspec.configure do |config|
-
end
require 'mongoa'
-require File.expand_path(File.dirname(__FILE__) + '/../lib/mongoa/mongo_mapper/association_matcher')
+require File.expand_path(File.dirname(__FILE__) + '/../lib/mongoa/mongo_mapper/matchers')
+class Post
+ include MongoMapper::Document
+
+ key :name, String
+
+ validates_presence_of :name
+ validates_length_of :name, :minimum => 4, :maximum => 32
+end
+
+class PostRequired
+ include MongoMapper::Document
+
+ key :name, String, :required => true, :length => 32
+ key :range_name, String, :required => true, :length => 0..56
+end
+
+class Within
+ include MongoMapper::Document
+
+ key :state, String
+
+ validates_inclusion_of :state, :within => ["new", "uploaded"]
+end
+
+class WithinIn
+ include MongoMapper::Document
+
+ key :state, String, :in => ["new", "uploaded"]
+end
\ No newline at end of file