Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mater does Rspec: `expect.to not_to`
RSpec::Matchers.define :not_to do
match { |actual| !actual }
end
RSpec.describe "Mater" do
specify "says `to not to' to mean false" do
expect(false).to not_to
expect(true).not_to not_to
end
end
# Mater
# says `to not to' to mean false
#
# Finished in 0.00073 seconds (files took 0.14261 seconds to load)
# 1 example, 0 failures
@jamis

This comment has been minimized.

Copy link
Owner Author

@jamis jamis commented Oct 20, 2015

Test failures are wonderful, too:

  1) Mater says `to not to' to mean false
     Failure/Error: expect(true).to not_to
       expected true to not to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.