Closed rlepidi closed 12 years ago
if you're trying to use the assertion methods its:
asserts_topic.includes 3
asserts_topic.empty
if you're trying to call their methods, you'll have to pass it to topic explicitly like:
asserts("that it includes 3") { topic.include? 3 }
asserts("that its empty") { topic.empty? }
Thanks, @achiu. Yep, the ?
at the end of the usage of the includes macro is the culprit. Makes we wonder again if we should aliases for this.
Thanks for the question, @ryeguy
Thanks guys.
Is that because they are the builtin macros? I admit I didn't scroll down all the way (just experimenting). I just assumed it'd delegate the call to the topic. Any reason why it doesn't just do that? That would be the expected behavior, imo.
At the very least the error message could be better.
As I said in comment on an issue yesterday:
I've been away a hell of a long time. Crazy things have happened. Hopefully those things are done. So, I'm going to pretend I didn't let all of these issues fester if everyone else agrees to play along and silently forgive me.
Hopefully, you'll also forgive me for the belated response.
Basically, one part of me really wants to support the query-able versions of these assertion macros. It seems logical/intuitive that you'd want to use include?
where you would use include
now, for instance, because include?
is pretty common language in ruby. However, I've always thought of the whole assertion as being a statement: asserts that X does include Y
or asserts that Foo is a kind of Thing
, for instance. I never thought of the assertion being: does X include Y?
or is Foo a kind of Thing?
.
So, there's that.
On top of that, I'm not too keen on possibly overriding some behavior that is built into every Object: respond_to?
and kind_of?
for instance.
All that said, I might just be thinking about this all wrong. Let me know.
Both of these:
Generate the same error:
(Line 6 is the line that has the query method on it)
Non-query methods work fine. Am I doing something wrong? This seems like too obvious of a bug to go undetected.