Provides assertions for your Minitest suite to determine if an object has been changed
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
minitest_change_assertions.gemspec

README.md

Minitest Change Assertions

Gem Version Build Status RubyGems Downloads Buy Me a Coffee

Provides assertions for your Minitest suite to determine if an object has been changed.

Install

gem 'minitest_change_assertions'

Usage

assert_changed

assert_changed 'user.name' do
  user.name = 'Bob'
end

assert_changed -> { user.name } do
  user.name = 'Bob'
end

### OR with optional :to argument

assert_changed 'user.name', to: 'Bob' do
  user.name = 'Bob'
end

assert_changed -> { user.name }, to: 'Bob' do
  user.name = 'Bob'
end

assert_not_changed

assert_not_changed 'user.name' do
  user.update(attrs)
end

assert_not_changed -> { user.name } do
  user.update(attrs)
end

### OR with optional :to argument

assert_not_changed 'user.name', to: 'Allen' do
  user.name = 'Bob'
end

assert_not_changed -> { user.name }, to: 'Allen' do
  user.name = 'Bob'
end

Credits

Created by Weston Ganger - @westonganger

For any consulting or contract work please contact me via my company website: Solid Foundation Web Development