-
Notifications
You must be signed in to change notification settings - Fork 757
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
Isolate unit tests #3836
Isolate unit tests #3836
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor points. Also, the documentation for UnitTest
should be updated to reflect that tests are now run on independent class instances.
@@ -1,56 +1,37 @@ | |||
|
|||
TestUnitTest : UnitTest { | |||
|
|||
var someVar,toreDown,count = 0; | |||
var someVar, setUp = false, toreDown = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now that we're not testing toreDown
, it and tearDown
can both be removed from this class
method = class.findMethod(method.asSymbol); | ||
if(method.isNil) { Error("Test method not found "+methodName).throw }; | ||
class.new.runTestMethod(method); | ||
*runAllTestMethods { |report = true| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a private method? I can't think of a case where using this method directly would be beneficial; it's more or less the same as run(false, report)
.
@brianlheim fixed the issues - thanks for your comments! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I thought this is well-known, but when we deprecate methods/classes they should be moved to the /deprecated
folder in SCClassLibrary. I will add something to DEVELOPING.md to that effect :)
nil | ||
}; | ||
|
||
this.deprecated(thisMethod, this.class.findRespondingMethodFor(\run)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be moved to the deprecations folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks!
Cool, thanks! |
This cleans up the UnitTest class and isolates the test methods by making an instance each (replaces #3626) .
This fixes #3572.