0.0
No commit activity in last 3 years
No release in over 3 years
Easy message expectation for tests in Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
 Project Readme

AssertSend

This little piece of work helps you know if an expected message was passed somewhere down your call stack.

Usage

It's quite simple. Imagine you want to make sure user.save gets called.

include AssertSend

user = User.find(...)

assert_send(user, :save) do
  your_dangerous_code!
end

If your_dangerous_code! doesn't call user.save in the call stack, it'll raise a AssertSend::ExpectationError.

It's important to know that this will not stub your method. The original implementation it's never tampered with.

If you're looking to stub things, I suggest you having a look at frodsan/mocoso.

Installation

gem install assert-send