Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone/Test::Unit DSL is crap #2

Open
rentalcustard opened this issue Jun 13, 2011 · 2 comments
Open

Standalone/Test::Unit DSL is crap #2

rentalcustard opened this issue Jun 13, 2011 · 2 comments

Comments

@rentalcustard
Copy link
Owner

Can we do anything better with the has_received? method?

@deepj
Copy link
Contributor

deepj commented Aug 20, 2011

What do you think exactly the DSL is crap? assert_(not_)received looks ok to me

@rentalcustard
Copy link
Owner Author

The assert_* methods are fine, in my opinion. It's what comes after that - e.g.

    assert_not_received(subject) { subject.has_received?.some_method }

We have to do this because you can't do the RSpec trick of:

   some_object.should some_matcher.some_method_chain.stuff.things

and know that #matches? will get called at the end. Take a look at the way RR does post-call matching in test/unit; it's very similar, for very similar reasons.

Maybe we could do something like:

assert_received(subject.some_method)

using some kind of cleverness, but honestly I haven't spent long enough thinking about it because I haven't had the need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants