Created
April 10, 2014 06:03
-
-
Save dasdom/10346561 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/perl -w | |
use strict; | |
if (not defined($ARGV[1])) { | |
die "usage: $0 <class name> <file with property names>\n"; | |
} | |
open(PROP, $ARGV[1]) || die "could not open property names file: $!\n"; | |
my $className = $ARGV[0]; | |
while (defined(my $line = <PROP>)) { | |
chomp($line); | |
print "- (void)testThat" . $className . "Has"; | |
print ucfirst($line) . "Property {\n"; | |
print "\tobjc_property_t " . $line . "Property = class_getProperty(["; | |
print $className . " class], \"" . $line . "\");\n"; | |
print "\tXCTAssertTrue(" . $line . "Property != NULL, @\""; | |
print $className . " should have a " . $line . " property.\");\n}\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment