Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 772 Bytes

README.textile

File metadata and controls

27 lines (20 loc) · 772 Bytes

About

RSpec2 matchers for DataMapper.

Usage

You must include DataMapperMatchers to your specs. It can be done in spec/spec_helper.rb:

Based off the dm-spec matchers by Botanicus.

Use these matchers in your specs. All the matchers you should call on model class, not on model instance.

Post.should has_property :title, String
Comment.should belongs_to(:post)
Post.has_many(:comments)
Post.has_one(:user)
Post.should has_and_belongs_to_many(:tags)
Post.should has_timestamps      # created_at, updated_at
Post.should has_timestamps(:at) # created_at, updated_at
Post.should has_timestamps(:on) # created_on, updated_on
Post.should has_timestamps(:created_at)

Still Working On
- has_validation
- has_key