Skip to content

The "Run Focused Should" commands fails when there's no enclosing context #1

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

Open
contentfree opened this issue Sep 26, 2010 · 3 comments

Comments

@contentfree
Copy link

This simple case fails:

class SubscriptionTest < ActiveSupport::TestCase
  should belong_to :user
end

It results in:
-:16: undefined method `empty?' for nil:NilClass (NoMethodError) This doesn't appear to be a TestCase class.

@contentfree
Copy link
Author

context is nil in this case, with the current command's code. A check for nil? would fix the error however, it would then disallow running the non-enclosed shoulds.

@contentfree
Copy link
Author

Additionally, even if the context being nil issue was solved, no focused should would be ran since should belong_to :user doesn't have any quotation marks to match. This is likely something that can't - without a lot of work - be hacked around.

@lazyatom
Copy link

I believe I fixed this in my fork.

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