Skip to content

Commit

Permalink
Merge pull request #704 from kiwi-bdd/698_rename_any_macro
Browse files Browse the repository at this point in the history
Rename any() macros to kw_any()
  • Loading branch information
ecaselles authored Jan 9, 2018
2 parents 28037d1 + 8c2cce9 commit a95c825
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Classes/Core/KiwiMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define fail(message, ...) [[[KWExampleSuiteBuilder sharedExampleSuiteBuilder] currentExample] reportFailure:[KWFailure failureWithCallSite:KW_THIS_CALLSITE format:message, ##__VA_ARGS__]]

// used for message patterns to allow matching any value
#define any() [KWAny any]
#define kw_any() [KWAny any]
#endif

// If a gcc compatible compiler is available, use the statement and
Expand Down
6 changes: 3 additions & 3 deletions Tests/KWMockTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ - (void)testItShouldStubWithASelectorReturnValueAndArguments {

- (void)testItShouldStubWithASelectorReturnValueAndAnyArguments {
id mock = [Cruiser nullMock];
[mock stub:@selector(energyLevelInWarpCore:) andReturn:theValue(30.0f) withArguments:any()];
XCTAssertEqual([mock energyLevelInWarpCore:3], 30.0f, @"expected method with any() arguments to be stubbed");
XCTAssertEqual([mock energyLevelInWarpCore:2], 30.0f, @"expected method with any() arguments to be stubbed");
[mock stub:@selector(energyLevelInWarpCore:) andReturn:theValue(30.0f) withArguments:kw_any()];
XCTAssertEqual([mock energyLevelInWarpCore:3], 30.0f, @"expected method with kw_any() arguments to be stubbed");
XCTAssertEqual([mock energyLevelInWarpCore:2], 30.0f, @"expected method with kw_any() arguments to be stubbed");
}

- (void)testItShouldStubWithAMessage {
Expand Down
2 changes: 1 addition & 1 deletion Tests/KWRealObjectStubTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ - (void)testItShouldStubInstanceMethodsReturningObjects {
- (void)testItShouldStubInstanceMethodsReturningObjectsWithAnyArguments {
Cruiser *cruiser = [Cruiser cruiserWithCallsign:@"Galactica"];
Fighter *fighter = [Fighter fighterWithCallsign:@"Viper 1"];
[cruiser stub:@selector(fighterWithCallsign:) andReturn:fighter withArguments:any()];
[cruiser stub:@selector(fighterWithCallsign:) andReturn:fighter withArguments:kw_any()];
XCTAssertEqual(fighter, [cruiser fighterWithCallsign:@"Foo"], @"expected method to be stubbed");
}

Expand Down

0 comments on commit a95c825

Please sign in to comment.