Hello all, I''m using RDT (Eclipse 3.1, RDT 0.6.0). Is there a way to run a specific method within my unit test file? I can run the whole test class, but it would be helpful to be able to execute one test from the class during development. Ideas? Thanks. Peter Fitzgibbons
Peter Fitzgibbons wrote:> Hello all, > > I''m using RDT (Eclipse 3.1, RDT 0.6.0). > > Is there a way to run a specific method within my unit test file? > I can run the whole test class, but it would be helpful to be able to > execute one test from the class during development. > > Ideas?Currently as it stands this is not possible. Ruby does a one-swipe read on .rb files and interpets as it goes. I dont see a real clean way to handle this atm. Bring it up on the RDT Mailing list, or email me privately and I''ll bring it up for you. This is all assuming I am understanding your request. Given the following code: class MyClass def meth end def meth2 end end You would like RDT to load and Run MyClass#meth for you? Zach
> You would like RDT to load and Run MyClass#meth for you?You can almost do this now but you have to run the test file through first. After running the full file look over at the Test::Unit view in the Hierarchy tab and you can right click on a specific method to run it only. It would be a great improvement to be able to run a single test directly, say, by right-clicking/context menu when one''s curser is on a test method.in the editor. Brian
On 10/19/05, Brian Buckley <briankbuckley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > You would like RDT to load and Run MyClass#meth for you? > > You can almost do this now but you have to run the test file through > first. After running the full file look over at the Test::Unit view > in the Hierarchy tab and you can right click on a specific method to > run it only. > > It would be a great improvement to be able to run a single test > directly, say, by right-clicking/context menu when one''s curser is on > a test method.in the editor. > > Brian > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >> It would be a great improvement to be able to run a single test > directly, say, by right-clicking/context menu when one''s curser is on > a test method.in the editor.yes, it would. See Visual Studio 2003 /w TestDriven.net -or- Visual Studio 2005 for examples. I''ll try your idea Brian. I have been running my tests as regular ruby runs, as I can read the text just as well has the pretty Test::Unit gui. If I use your method, will the runner reload the class or use a cached copy of it ? (IE: If i make a change and test the method, will I get the old code or the new code tested ?) Thanks for your advice! Peter Fitzgibbons
> yes, it would. See Visual Studio 2003 /w TestDriven.net -or- Visual > Studio 2005 for examples.Also see Intelli''s IDEA use of this.> I''ll try your idea Brian. I have been running my tests as regular > ruby runs, as I can read the text just as well has the pretty > Test::Unit gui. > If I use your method, will the runner reload the class or use a cached > copy of it ? > (IE: If i make a change and test the method, will I get the old code > or the new code tested ?)New code is run so long as you say ''yes'' to the prompt you''ll get to save unsaved files. Incidentally the command line way to run a single test in test_foo.rb is ruby test_foo --name test_method Brian
On 10/20/05, Brian Buckley <briankbuckley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > yes, it would. See Visual Studio 2003 /w TestDriven.net -or- Visual > > Studio 2005 for examples. > > Also see Intelli''s IDEA use of this. > > > I''ll try your idea Brian. I have been running my tests as regular > > ruby runs, as I can read the text just as well has the pretty > > Test::Unit gui. > > If I use your method, will the runner reload the class or use a cached > > copy of it ? > > (IE: If i make a change and test the method, will I get the old code > > or the new code tested ?) > > New code is run so long as you say ''yes'' to the prompt you''ll get to > save unsaved files. > > Incidentally the command line way to run a single test in test_foo.rb is > > ruby test_foo --name test_method > > Brian > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >> ruby test_foo --name test_methodOoh, brilliant !