Skip to content

Instantly share code, notes, and snippets.

@rrcobb
Created January 23, 2018 00:08
Show Gist options
  • Save rrcobb/dbfe6ed389cd3e80d33517f57389d88e to your computer and use it in GitHub Desktop.
Save rrcobb/dbfe6ed389cd3e80d33517f57389d88e to your computer and use it in GitHub Desktop.
Rspec negated change matcher
# This should be in rspec core, but add it here so we can chain negative change expectations, like
# expect { do_thing }.to change {a}.and not_change {b}.and change {b}
RSpec::Matchers.define_negated_matcher :not_change, :change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment