foo.should_receive( :save ).with( html )
Where html
is an HTML string, but I don't want to check against specific HTML because that would make the test brittle.
Is there a way to check the length of the param that foo should receive? Is it possible to use a matcher or something like html.should include '<html'
?
Working in RSpec.
As stated in the comment above you can use a regex for the argument matcher.
If you want to do more complicated assertions you can provide a block: