README.markdown in dm-rspec-0.1.1 vs README.markdown in dm-rspec-0.1.2

- old
+ new

@@ -1,6 +1,6 @@ -# dm-rspec +# dm-rspec (RSpec matchers for DataMapper) by Potapov Sergey (aka Blake) A set of rspec matchers to test DataMapper models like you test ActiveRecord models with rspec-rails. @@ -17,13 +17,14 @@ RSpec.configure do |config| config.include(DataMapper::Matchers) end -In your spec files you can use the next matchers: +In your spec files you can use the next matchers to test appropriate DataMapper's validations: * belong\_to +* have\_one * have\_many * have\_many\_and\_belong\_to * have\_property * have(n).errors\_on(:property) * have\_many(:association).trough(:another\_association) @@ -32,11 +33,11 @@ * validate\_format\_of(:property).with(/regexp/) ## Examples -Assume you have the next models: +Assume you have the next data mapper models: class Book include DataMapper::Resource property :id, Serial property :name, String @@ -64,11 +65,11 @@ specify {Book.should belong_to :author} specify {Author.should have_many :books} specify {Genre.should have_many_and_belong_to :books} specify {Books.should have_many_and_belong_to :genres} - specify {Books.should validates_presence_of :name} + specify {Books.should validate_presence_of :name} it 'has errors' do book = Book.new(:name => 'fails on two validations') book.valid? book.should have(2).errors_on(:name) @@ -76,10 +77,10 @@ ## TODO -Implement the next matchers: +Implement the next rspec matchers: * have timestamps * matchers to verify validations