Make Crtl+R run any currently edited test case
Brought to you by:
gianasista
Make Crtl+R run any currently edited test case, whether it correspond to a given class or not.
Currently, a test case open in the editor is launched by the Ctrl+R shortcut only if MoreUnit found a correspondence with a production class. This is highly disappointing for an user that is used to this shortcut, when a test won't run just because it is not "managed" by MoreUnit.
I like the actual behaviour and use it a lot. Perhaps we should use a second shortcut or make it configurable via preferences.
Maybe I was not clear enough, or maybe I misunderstood you: are you saying that it is actually useful to you that Ctrl+R does nothing on a test case that is not recognized as corresponding to a CUT?
Here is an example of what I want to point out: a test case class named "SomethingTest" is open in my editor, and there is no corresponding CUT (for instance a class named "Something" if MoreUnit is configured to recognize test cases as having the suffix "Test"). If I hit Ctrl+R on it, it won't do anything. I find it disappointing because I always use Ctrl+R to launch a test case (rather than the standard Alt+Shift+X,T) and I don't think it will do any harm to also support launching such test cases. And if you wonder how I have this situation: I have a lot of integration tests, that do not directly correspond to a single class.
It seems that I misunderstood what you meant.
What I thought is the following change:
I do edit the testcases ATest, BTest and CTest. If I use Ctrl+R in BTest now all three test (ATest, BTest and CTest) will run because I changed them.
And this scenario is what I don't expect.
But your second comment as made it clear now and I think this is a good idea.
Indeed it would have been a disturbing idea :-(
So go for the right one!
I just tested and it works, with a restriction: the test case must follow the naming pattern defined in the preferences. Out of curiosity, I dig into the project history, and at the time this request has been opened, it was in fact already possible.
So I think the exact request is to launch a test case — having a corresponding test class or not — even if it does not conform to the naming pattern defined.
And indeed, I remember that at the time I had a lot of test classes ending with "IT", for "integration test".
I think it is still a good idea to try launch anything that can be launched as a test, so I will implement it.
Implemented in upcoming version