Skip to content

zenom/dm-rspec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rspec2 matchers for Data Mapper

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages