Created
October 28, 2010 03:13
-
-
Save itfrombit/650544 to your computer and use it in GitHub Desktop.
Detecting when nush is accidentally run instead of nutest on a NuTestCase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/objc/nu.m b/objc/nu.m | |
index 1d21a56..170206c 100644 | |
--- a/objc/nu.m | |
+++ b/objc/nu.m | |
@@ -230,6 +230,12 @@ int NuMain(int argc, const char *argv[], const char *envp[]) | |
@catch (NuException* nuException) | |
{ | |
printf("%s\n", [[nuException dump] cStringUsingEncoding:NSUTF8StringEncoding]); | |
+ if ([[nuException name] isEqualToString:@"NuUndefinedSuperclass"]) { | |
+ NSArray* a = [[nuException reason] componentsSeparatedByString:@" "]; | |
+ if (([a count] == 3) && ([[a objectAtIndex:2] isEqualToString:@"NuTestCase"])) { | |
+ printf("Did you mean to use nutest instead of nush?\n"); | |
+ } | |
+ } | |
} | |
@catch (id exception) | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment