Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dblock/ocmock-expecta
Expecta matchers for OCMock
https://github.com/dblock/ocmock-expecta
Last synced: 16 days ago
JSON representation
Expecta matchers for OCMock
- Host: GitHub
- URL: https://github.com/dblock/ocmock-expecta
- Owner: dblock
- License: mit
- Created: 2014-01-19T19:21:36.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-10-01T08:53:44.000Z (about 9 years ago)
- Last Synced: 2024-03-15T10:20:52.375Z (8 months ago)
- Language: Objective-C
- Size: 218 KB
- Stars: 33
- Watchers: 6
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Expecta-OCMock
==============[Expecta](https://github.com/specta/expecta) matchers for [OCMock 3.x](https://github.com/erikdoe/ocmock).
## Examples
```objc
// First check that a method is called
// Note: it will still call said method in the test. It's not stubbed.
// These never stub.it(@"checks for a method", ^{
@mockify(sut);expect(sut).to.receive(@selector(method));
[sut method];
});// Checks that a method has been called.
// Then calls it again at the end of the test to check it's return value.
// be wary if you have side-effects with this.it(@"checks for a return value", ^{
@mockify(sut);
expect(sut).receive(@selector(method2)).returning(@2);
[sut method2];
});// Checks that something has been called and that it has the expected arguments
it(@"checks for an argument to the method", ^{
@mockify(sut);
expect(sut).receive(@selector(method3:)).with(@[@"thing"]);
[sut method3:@"thing"];
});
```### Get it
```
pod "Expecta+OCMock", "~> 2.0"
```For OCMock 2 support,
```
pod "Expecta+OCMock", "~> 1.0"
```### License
MIT, see [LICENSE](LICENSE.md)