No commit activity in last 3 years
No release in over 3 years
should_change / should_create / should_destroy matchers for shoulda 3 backported from shoulda 2
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
 Project Readme

should_change / should_create / should_destroy matchers for shoulda 3 backported from shoulda 2
so you can upgrade to shoulda 3 without rewriting major parts of your test-base.

# Gemfile
gem "shoulda-change_matchers", :require => "shoulda/change_matchers"

Usage

context "creating" do
  setup do
    User.create!
    User.create!
  end

  should_change("the number of users", :by => 2) { User.count }
end

context "doing nothing" do
  should_not_change("the number of users") { User.count }
end

context "creating" do
  setup{ User.create! }
  should_create :user
end

context "destroying" do
  setup{ User.delete_all }
  should_destroy :user
end

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status