Why generate a class? this could make things hard to find. Just make a tool that adds a new method to "MiscTestCase". Maybe we won't accept this mess into the image <g>, but it makes adding a test trivial, and if it's good, it certainly can be maintained by someone on SM, and it's very easy to factor it out into it's own class in time.
Daniel
Mike Roberts mike@mjr104.co.uk wrote:
On Fri, Feb 28, 2003 at 05:39:52PM +0100, Andreas Raab wrote:
Add a place to Squeak where it's _really_ easy to write a single test without having to make a class first
I like your thoughts. How about a 'Test Pit' which is similar to a Workspace but allows you to write simple assertions about what you are testing. I can imagine how it would work but don't know how to implement it... (except in Python). Could you bind a subset of the methods of TestCase into the scope of the workspace so you could just write quick statements and then hit a button to do-it all and give you a quick result. Or maybe you could have a global QuickTest bound in the workspace which provided assert: deny: etc. Then you could possibly hit a button to generate a proper class for you after asking you for the name. If the text in the workspace only used the protocol of TestCase then it could just become the body of a test - you could neaten it up/ improve with the browser(s) later.
The only thing I'm not quite sure about is getting the objects in that you want to test if they already exist somewhere. Maybe you could enable morph-workspace dropping, although I haven't played with that yet so I'm not exactly sure how that works.
Does this sound like what you had in mind?
If this was in the Tools flap then you could grab it out, write a test and then there could be suitable buttons for 'mail to list' etc.
Mike _______________________________________________ Squeakfoundation mailing list Squeakfoundation@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/squeakfoundation
On Friday 28 February 2003 02:59 pm, Daniel Vainsencher wrote:
Why generate a class? this could make things hard to find. Just make a tool that adds a new method to "MiscTestCase". Maybe we won't accept this mess into the image <g>, but it makes adding a test trivial, and if it's good, it certainly can be maintained by someone on SM, and it's very easy to factor it out into it's own class in time.
The only limitation is that we can't do anything in the startUp or tearDown methods.
But if you have a fully self-contained test, that would be a good idea.
Perhaps I should add it to the TestRunner enhancements.
On Sat, Mar 01, 2003 at 01:59:32AM +0300, Daniel Vainsencher wrote:
Why generate a class? this could make things hard to find. Just make a tool that adds a new method to "MiscTestCase". Maybe we won't accept this mess into the image <g>, but it makes adding a test trivial, and if it's good, it certainly can be maintained by someone on SM, and it's very easy to factor it out into it's own class in time.
Have you tried "Browser Unit Test Support" from SqueakMap?
This definitly is a step in the right direction:
Summary: Adds some unit testing support facilities in the browsers Author: Romain Robbes Maintainer: Romain Robbes
Description:
This package adds a few buttons to the browsers in order to have a better integration of unit tests during class developpement. It enables you to easily switch back and forth from a class and it's unit test, allowing the same thing a the method level. It also adds a convenient way to run the test of the current class, giving automatic feedback to the user. Moreover, test creation is handled automagically if a class test/method test doesn't exist yet (don't worry, the choice is up to you :-)). Last and not least, it works for nearly all kinds of class browsers, and so integrates nicely with the RefactoringBrowser and the StarBrowser.
Marcus
squeakfoundation@lists.squeakfoundation.org