Permalink
Browse files

Convert \t to 4 spaces. Rm trailing whitespace.

  • Loading branch information...
1 parent 329315b commit b940a6e8899203e0cd701570f44b993326c4f55f @ma11hew28 ma11hew28 committed Aug 10, 2011
Showing with 358 additions and 358 deletions.
  1. +1 −1 Classes/KiwiAppDelegate.m
  2. +4 −4 Classes/KiwiViewController.m
  3. +1 −1 Classes/StringPrefixMatcher.m
  4. +2 −2 Classes/TestReporter.m
  5. +14 −14 Examples/ExampleAsyncSpec.m
  6. +15 −15 Examples/ExampleSpec.m
  7. +4 −4 Examples/ExampleTestCase.m
  8. +6 −6 Examples/SimpleSpec.m
  9. +2 −2 Kiwi/KWAsyncVerifier.h
  10. +4 −4 Kiwi/KWAsyncVerifier.m
  11. +1 −1 Kiwi/KWBeBetweenMatcher.m
  12. +1 −1 Kiwi/KWBeNonNilMatcher.h
  13. +1 −1 Kiwi/KWBeTrueMatcher.m
  14. +1 −1 Kiwi/KWBlock.m
  15. +4 −4 Kiwi/KWBlockNode.m
  16. +7 −7 Kiwi/KWBlockRaiseMatcher.m
  17. +5 −5 Kiwi/KWContainMatcher.m
  18. +4 −4 Kiwi/KWContextNode.m
  19. +12 −12 Kiwi/KWExampleGroupBuilder.m
  20. +1 −1 Kiwi/KWExistVerifier.m
  21. +5 −5 Kiwi/KWFormatter.m
  22. +2 −2 Kiwi/KWHamrestMatchingAdditions.m
  23. +11 −11 Kiwi/KWHaveMatcher.m
  24. +1 −1 Kiwi/KWHaveValueMatcher.h
  25. +12 −12 Kiwi/KWHaveValueMatcher.m
  26. +4 −4 Kiwi/KWInequalityMatcher.m
  27. +3 −3 Kiwi/KWIntercept.m
  28. +3 −3 Kiwi/KWInvocationCapturer.m
  29. +8 −8 Kiwi/KWMatchVerifier.m
  30. +4 −4 Kiwi/KWMatcher.m
  31. +7 −7 Kiwi/KWMatcherFactory.m
  32. +4 −4 Kiwi/KWMatchers.m
  33. +7 −7 Kiwi/KWMessagePattern.m
  34. +1 −1 Kiwi/KWMessageTracker.m
  35. +33 −33 Kiwi/KWMock.m
  36. +1 −1 Kiwi/KWNull.m
  37. +1 −1 Kiwi/KWObjCUtilities.m
  38. +1 −1 Kiwi/KWPendingNode.m
  39. +2 −2 Kiwi/KWProbePoller.m
  40. +5 −5 Kiwi/KWRaiseMatcher.m
  41. +8 −8 Kiwi/KWReceiveMatcher.m
  42. +1 −1 Kiwi/KWRegisterMatchersNode.m
  43. +1 −1 Kiwi/KWSpec.h
  44. +35 −35 Kiwi/KWSpec.m
  45. +10 −10 Kiwi/KWStringUtilities.m
  46. +3 −3 Kiwi/KWStub.m
  47. +12 −12 Kiwi/KWTestCase.m
  48. +1 −1 Kiwi/KWUserDefinedMatcher.h
  49. +6 −6 Kiwi/KWUserDefinedMatcher.m
  50. +5 −5 Kiwi/KWValue.m
  51. +1 −1 Kiwi/KWWorkarounds.m
  52. +1 −1 Kiwi/Kiwi.h
  53. +5 −5 Kiwi/NSInvocation+KiwiAdditions.m
  54. +3 −3 Kiwi/NSObject+KiwiStubAdditions.m
  55. +18 −18 Readme.md
  56. +4 −4 Tests/KWBlockRaiseMatcherTest.m
  57. +3 −3 Tests/KWContainMatcherTest.m
  58. +7 −7 Tests/KWHaveMatcherTest.m
  59. +4 −4 Tests/KWHaveValueMatcherTest.m
  60. +4 −4 Tests/KWInequalityMatcherTest.m
  61. +4 −4 Tests/KWRaiseMatcherTest.m
  62. +2 −2 Tests/KWRealObjectSpyTest.m
  63. +2 −2 Tests/KWStringUtilitiesTest.m
  64. +3 −3 Tests/KWTestCaseTest.m
  65. +10 −10 Tests/KWUserDefinedMatcherTest.m
@@ -16,7 +16,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
// Override point for customization after app launch
[window addSubview:viewController.view];
[window makeKeyAndVisible];
- return YES;
+ return YES;
}
- (void)dealloc {
@@ -42,15 +42,15 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
*/
- (void)didReceiveMemoryWarning {
- // Releases the view if it doesn't have a superview.
+ // Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
+ // Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
- // Release any retained subviews of the main view.
- // e.g. self.myOutlet = nil;
+ // Release any retained subviews of the main view.
+ // e.g. self.myOutlet = nil;
}
@@ -34,7 +34,7 @@ - (BOOL)matches:(id)item
{
if (![item respondsToSelector:@selector(hasPrefix:)])
return NO;
-
+
return [item hasPrefix:prefix];
}
View
@@ -25,7 +25,7 @@ - (id)init {
if ((self = [super init])) {
failures = [[NSMutableArray alloc] init];
}
-
+
return self;
}
@@ -50,7 +50,7 @@ - (void)dealloc {
- (void)reportFailure:(KWFailure *)aFailure {
if (aFailure == nil)
return;
-
+
self.hasUnmetExpectations = YES;
[failures addObject:aFailure];
}
@@ -18,74 +18,74 @@
it(@"should verify asynchronous expectations on a variable that starts as nil that succeed in time", ^{
__block NSString *fetchedData = nil;
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
fetchedData = @"expected response data";
});
-
+
// this will block until the matcher is satisfied or it times out (default: 1s)
[[theObject(&fetchedData) shouldEventually] equal:@"expected response data"];
});
it(@"should verify asynchronous expectations on a variable that starts as nil that succeed with an explicit time", ^{
__block NSString *fetchedData = nil;
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
fetchedData = @"expected response data";
});
-
+
// this will block until the matcher is satisfied or it times out (default: 1s)
[[theObject(&fetchedData) shouldEventuallyBeforeTimingOutAfter(2.0)] equal:@"expected response data"];
});
it(@"should verify asynchronous expectations on the return value of a block", ^{
__block NSString *fetchedData = nil;
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
fetchedData = @"expected response data";
});
-
+
[[expectFutureValue([fetchedData uppercaseString]) shouldEventually] equal:@"EXPECTED RESPONSE DATA"];
});
it(@"should verify asynchronous mock expectations on an existing object set before the asynchronous call", ^{
__block id mock = [KWMock mockForClass:[NSString class]];
-
+
[[[mock shouldEventually] receive] uppercaseString];
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
[mock uppercaseString];
});
});
it(@"should verify asynchronous mock expectations on an existing object set after the asynchronous call", ^{
__block id mock = [KWMock mockForClass:[NSString class]];
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
[mock uppercaseString];
});
-
+
[[[mock shouldEventually] receive] uppercaseString];
});
it(@"should verify asynchronous expectations on a variable that starts as nil and becomes not-nil", ^{
__block NSString *fetchedData = nil;
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
fetchedData = @"expected response data";
});
-
+
// this will block until the matcher is satisfied or it times out (default: 1s)
[[theObject(&fetchedData) shouldEventually] beNonNil];
});
it(@"should verify asynchronous expectations on a variable that starts as non-nil and becomes nil", ^{
__block NSString *fetchedData = @"not nil";
-
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * nanosecondToSeconds), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
fetchedData = nil;
});
-
+
// this will block until the matcher is satisfied or it times out (default: 1s)
[[theObject(&fetchedData) shouldEventually] beNil];
});
View
@@ -26,73 +26,73 @@
describe(@"Cruiser", ^{
registerMatchers(@"KWT");
-
+
context(@"with fighters set", ^{
__block Cruiser *cruiser = nil;
-
+
beforeAll(^{
});
-
+
afterAll(^{
});
-
+
beforeEach(^{
cruiser = [Cruiser cruiser];
[cruiser stub:@selector(raiseShields) andReturn:theValue(NO)];
[cruiser setFighters:[NSArray arrayWithObjects:[Fighter fighterWithCallsign:@"Viper 1"],
[Fighter fighterWithCallsign:@"Viper 2"],
[Fighter fighterWithCallsign:@"Viper 3"], nil]];
-
+
});
-
+
pending(@"should be really big", nil);
-
+
it(@"should have fighters", ^{
[[[cruiser should] have:3] fighters];
[[cruiser.fighters shouldNot] beEmpty];
[Cruiser stub:@selector(classification) andReturn:@"Animal"];
});
-
+
it(@"should raise shields", ^{
[[[Cruiser classification] should] equal:@"Capital Ship"];
[[theValue([cruiser raiseShields]) should] beFalse];
[[cruiser should] receive:@selector(fighterWithCallsign:)];
[cruiser fighterWithCallsign:@"Apollo"];
});
-
+
it(@"should raise if asked", ^{
[[[Cruiser classification] should] equal:@"Capital Ship"];
[[lambda(^{
[cruiser raiseWithName:@"FooException" description:@"Foo"];
}) should] raiseWithName:@"FooException"];
});
-
+
defineMatcher(@"haveFighters", ^(KWUserDefinedMatcherBuilder *builder) {
[builder match:^(id subject) {
if (![subject isKindOfClass:[Cruiser class]]) {
return NO;
}
Cruiser *cruiser = subject;
- return cruiser.fighters.count > 0;
+ return cruiser.fighters.count > 0;
}];
[builder failureMessageForShould:^(id subject) {
return [NSString stringWithFormat:@"%@ should have fighters", subject];
}];
});
-
+
it(@"should have fighters (using custom matcher)", ^{
[[cruiser should] haveFighters];
});
-
+
it(@"should work with @dynamic properties", ^{
[[cruiser.classification should] equal:@"Capital Ship"];
});
-
+
it(@"should allow @dynamic properties to be stubbed with message pattern", ^{
[[cruiser stubAndReturn:@"Galaxy Class Ship"] classification];
[[cruiser.classification should] equal:@"Galaxy Class Ship"];
});
-
+
it(@"should allow @dynamic properties to be stubbed with API", ^{
[cruiser stub:@selector(classification) andReturn:@"Galaxy Class Ship"];
[[cruiser.classification should] equal:@"Galaxy Class Ship"];
@@ -33,7 +33,7 @@ - (void)itShouldVerifyEquality {
id subject = @"foo";
id otherSubject = @"foo";
[[subject should] equal:otherSubject];
-
+
otherSubject = @"bar";
[[subject shouldNot] equal:otherSubject];
}
@@ -142,13 +142,13 @@ - (void)itShouldVerifyReceivedMessages {
id subject = [Cruiser cruiser];
[[subject should] receive:@selector(raiseShields) withCountAtLeast:1];
[subject raiseShields];
-
+
subject = [Cruiser cruiser];
- [[[subject should] receiveAndReturn:theValue(42) withCountAtLeast:2] crewComplement];
+ [[[subject should] receiveAndReturn:theValue(42) withCountAtLeast:2] crewComplement];
[subject crewComplement];
NSUInteger complement = [subject crewComplement];
[[theValue(complement) should] equal:theValue(42)];
-
+
subject = [Cruiser cruiser];
[[subject should] receive:@selector(energyLevelInWarpCore:) andReturn:theValue(1.01f) withCount:2 arguments:theValue(2)];
[subject energyLevelInWarpCore:2];
View
@@ -10,28 +10,28 @@
describe(@"stack", ^{
__block NSMutableArray *arr = nil;
-
+
context(@"new", ^{
beforeEach(^{
arr = [NSMutableArray array];
[arr addObject:@"shark"];
});
-
+
context(@"with 2 items", ^{
beforeEach(^{
[arr addObject:@"dolphin"];
});
-
+
it(@"has the first item", ^{
[[arr should] contain:@"shark"];
});
-
+
it(@"has the second item", ^{
[[arr should] contain:@"dolphin"];
});
-
+
specify(^{ [[arr should] haveCountOf:2]; });
-
+
xit(@"has some funky behaviour", ^{});
});
});
View
@@ -14,7 +14,7 @@
@class KWAsyncMatcherProbe;
-@interface KWAsyncVerifier : KWMatchVerifier
+@interface KWAsyncVerifier : KWMatchVerifier
{
NSInteger timeout;
}
@@ -30,6 +30,6 @@
BOOL matchResult;
}
@property (nonatomic, readonly) id<KWMatching> matcher;
-
+
- (id)initWithMatcher:(id<KWMatching>)aMatcher;
@end
View
@@ -26,7 +26,7 @@ + (id)asyncVerifierWithExpectationType:(KWExpectationType)anExpectationType call
- (id)initWithExpectationType:(KWExpectationType)anExpectationType callSite:(KWCallSite *)aCallSite matcherFactory:(KWMatcherFactory *)aMatcherFactory reporter:(id<KWReporting>)aReporter {
if ((self = [super initWithExpectationType:anExpectationType callSite:aCallSite matcherFactory:aMatcherFactory reporter:aReporter])) {
self.timeout = kKW_DEFAULT_PROBE_TIMEOUT;
- }
+ }
return self;
}
@@ -48,10 +48,10 @@ - (void)verifyWithProbe:(KWAsyncMatcherProbe *)aProbe {
}
}
[poller release];
-
+
} @catch (NSException *exception) {
KWFailure *failure = [KWFailure failureWithCallSite:self.callSite message:[exception description]];
- [self.reporter reportFailure:failure];
+ [self.reporter reportFailure:failure];
}
}
@@ -70,7 +70,7 @@ - (id)initWithMatcher:(id<KWMatching>)aMatcher;
{
if ((self = [super init])) {
matcher = [aMatcher retain];
-
+
// make sure the matcher knows we are going to evaluate it multiple times
if ([aMatcher respondsToSelector:@selector(willEvaluateMultipleTimes)]) {
[aMatcher setWillEvaluateMultipleTimes:YES];
@@ -47,7 +47,7 @@ + (NSArray *)matcherStrings {
- (BOOL)evaluate {
if (![self.subject respondsToSelector:@selector(compare:)])
[NSException raise:@"KWMatcherException" format:@"subject does not respond to -compare:"];
-
+
NSComparisonResult lowerResult = [self.subject compare:self.lowerEndpoint];
NSComparisonResult upperResult = [self.subject compare:self.upperEndpoint];
return (lowerResult == NSOrderedDescending || lowerResult == NSOrderedSame) &&
View
@@ -10,7 +10,7 @@
#import "KWMatcher.h"
@interface KWBeNonNilMatcher : KWMatcher {
-
+
}
- (void)beNonNil;
@end
View
@@ -35,7 +35,7 @@ + (NSArray *)matcherStrings {
- (BOOL)evaluate {
if (![self.subject respondsToSelector:@selector(boolValue)])
[NSException raise:@"KWMatcherException" format:@"subject does not respond to -boolValue"];
-
+
return [self.subject boolValue] == self.expectedValue;
}
View
@@ -24,7 +24,7 @@ - (id)initWithBlock:(KWVoidBlock)aBlock {
if ((self = [super init])) {
block = Block_copy(aBlock);
}
-
+
return self;
}
Oops, something went wrong.

0 comments on commit b940a6e

Please sign in to comment.