Latest 0.1.0
Homepage https://github.com/marcelofabri/Staged
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

CI Status
codecov
Version
License
Platform

Staged allows you to easily mock View Controllers presentations and dismissals, so you don’t have to create a window just to test them.

Usage

Just import #import <Staged/STGViewControllerVerifier.h> and use like this:

STGViewControllerVerifier *verifier = [[STGViewControllerVerifier alloc] init];
UIViewController *viewController = [[UIViewController alloc] init];

// sut is the system under test
[sut presentSomeOtherControllerOn:viewController];

expect(verifier.presenterViewController).to.equal(viewController);
expect(verifier.presentedViewController).to.beKindOf([SomeCoolViewController class]);
expect(verifier.presentedAnimated).to.beTruthy();
expect(verifier.presentedCount).to.equal(1);

This is using Expecta matchers, but you can be boring and use the default ones as well.

You can also check if a view controller was dismissed:

STGViewControllerVerifier *verifier = [[STGViewControllerVerifier alloc] init];

[sut doSomethingThatShouldDismissAViewController];

expect(verifier.dismissedViewController).to.beKindOf([SomeCoolViewController class]);
expect(verifier.dimissedAnimated).to.beFalsy();
expect(verifier.dismissedCount).to.equal(1);

Requirements

iOS 8

Installation

Staged is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "Staged"

Author

Marcelo Fabri, @marcelofabri_

Thanks

Need help?

Please submit an issue on GitHub and provide information about your setup.

License

Staged is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "Staged",
    "version": "0.1.0",
    "summary": "Mock View Controllers presentations and dismissals on unit tests",
    "description": "Staged allows you to easily mock View Controllers presentations and dismissals, so you don't have to create a window just to test them.",
    "homepage": "https://github.com/marcelofabri/Staged",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Marcelo Fabri": "[email protected]"
    },
    "source": {
        "git": "https://github.com/marcelofabri/Staged.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/marcelofabri_",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Staged/Classes/**/*",
    "public_header_files": "Staged/Classes/STGViewControllerVerifier.h",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This