Skip to content

orta/Expecta-ContainerClasses

Repository files navigation

Expecta+ContainerClasses

Version Platform Build Status

What it does

The best example is testing API callbacks for types:

it(@"does something from an API", ^AsyncBlock {

	ARImageDownloader *downloader = [[ARImageDownloader alloc] init];
		[downloader downloadImages:^(NSArray *objects) {
		...
		expect(objects).to.containInstancesOfClass(ARImageFormat.class);
		...
		done();
	}];
});

if you prefer you can also use onlyContainInstancesOfClass. Also gives back a useful fail message telling you what other classes have sneaked into your set or an array.

Installation

Expecta+ContainerClasses is available through CocoaPods, to install it simply add the following line to your Podfile:

pod "Expecta+ContainerClasses"

It's likely that you'll want this in a testing subset, this usually looks like:

target 'MyApp Tests', :exclusive => true do
    pod 'Specta',      '~> 0.3'
    pod 'Expecta',     '~> 0.3'
    pod 'Expecta+ContainerClasses', '~> 1.0'
end

Author

@Orta, orta.therox@gmail.com

http://orta.github.io

License

Expecta+ContainerClasses is available under the MIT license. See the LICENSE file for more info.

About

Adds containInstancesOfClass to expecta's matchers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published