Sha256: c2d069ef7164e8ea1d58c55b3e5d3fdbba7dd99711147d55ce335a2ca0a4f60b

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

= assert_difference

Better assert_difference than Rails by providing a more compact and readable
syntax through hashes. Instead of writing:

    assert_difference "Article.count" do
      assert_difference "assigns(:article).comments(:reload).size" do
        assert_difference "Article.count", -1 do
          post :something
        end
      end
    end

you can *now* write:

    assert_difference "Article.count" => 1, "assigns(:article).comments(:reload).size" => 1, "Article.count" => -1 do
      post :something
    end

For some more information read http://pupeno.com/blog/better-assert-difference

== Note on Patches/Pull Requests

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a
  future version unintentionally.
* Commit, do not mess with rakefile, version, or history.
  (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
* Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 José Pablo Fernández. See LICENSE for details.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assert_difference-0.1.0 README.rdoc