Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

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

Topics

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.