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

Assertions #11

Open
JEG2 opened this issue Jan 30, 2010 · 3 comments
Open

Assertions #11

JEG2 opened this issue Jan 30, 2010 · 3 comments

Comments

@JEG2
Copy link

JEG2 commented Jan 30, 2010

Some of the assertions in the Rails bundle are problematic, in my opinion.

First, assert_response(), the assert_redirected_to() family of methods, and assert_rjs() don't match the snippet trigger conventions. I think they should have triggers of asr, asrt, and asr respectively. I also think the assert_redirected_to() triggers should loose all of their special trigger suffixes. It can be sorted out by a pop-up menu from TextMate.

The other issue I'm aware of is that the Rails bundle is masking some Ruby bundle triggers. ass for assert_select() hides assert_same() and assert_send() from the Ruby bundle. Also, if you follow my advice above and switch the triggers above, you will begin hiding assert_raise() under asr.

This is one of those rare cases where TextMate scopes hurt us. Rails is a more specific scope an wins matches, hiding the Ruby functionality. Since we encourage Rails developers to just switch Ruby files to the Rails scope, they tend to lose this functionality globally. I think it's more correct to keep the Rails bundle being the Ruby bundle plus to support this usage pattern.

I'm not sure what the right way to fix it is. I guess the best we can do is rescope the problematic triggers as normal Ruby, instead of Rails. This means they will be added in even outside of the Rails scopes, but at least they would stop hiding options from the Ruby bundle. I'm open to other ideas though.

@drnic
Copy link
Owner

drnic commented Mar 4, 2010

I'm ok with the bundle triggers for assert_* to be changed. Specifically, I am happy to go to the "as" prefix.

I don't personally use the test/unit snippets.

@drnic
Copy link
Owner

drnic commented Mar 4, 2010

Ok, I've changed the few snippets that don't follow the basic rule.

For the clashes, assert_select (ass) etc, do you have any new thoughts?

@JEG2
Copy link
Author

JEG2 commented Mar 4, 2010

The best I can think of still is to scope them as normal Ruby. At least that would stop them from hiding features. You might try asking in ##textmate though, just to make sure there aren't other ideas.

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