This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | not all tests are run when 'inherited()' is used in test class | ||
---|---|---|---|
Product: | ruby | Reporter: | bgoodspeed <bgoodspeed> |
Component: | Testing | Assignee: | issues@ruby <issues> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P4 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | test case to demonstrate focused unit test problem |
Description
bgoodspeed
2009-02-09 02:21:40 UTC
Created attachment 76722 [details]
test case to demonstrate focused unit test problem
This bug is triggered when you right click the test and invoke "test file" or "run file" Thanks for the report, reproduced with the file you attached. I'll have a look at this. I'm not sure yet how to fix this in NB, but as a workaround you can get your tests working by implementing the inherited method in your test case as follows: class << self alias_method :org_inherited, :inherited def inherited(sub) org_inherited(sub) sub.class_eval do define_method :test_meta_programming do assert_equal "meta", "not meta :(" end end end end The problem with the way it's done in the example you attached is that it doesn't delegate to previous implementations, which causes problems since the NB test runner also needs to implement this method. I'll see if I can somehow come up with another solution, but as long as we need to implement inherited in the test runner it might be a bit challenging. I suppose this issue doesn't affect that many users, and there is a workaround for this, so I'm adjusting the priority for now - let's increase it again if more folks run into this. Also, I haven't been thinking about this too much lately, but I still can't come up with with a way to fix the NB test runner to avoid the issue. |