Git Product home page Git Product logo

mockit's People

Contributors

andraskadar avatar jotaemepereira avatar lfarah avatar markcdb avatar sabirvirtuoso avatar syedmusawi avatar vinutaprabhu avatar wowbroforce avatar yunuserenguzel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mockit's Issues

Async

I'm curious to know what approach you recommend when trying to verify mocks in an async setup. I'm using Quick/Nimble if that matters.

Add Manual Installation

CocoaPods is an awesome tool and it makes our life really easier, but there are some devs who still don't know how to use them.

It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

OSX Compatibility

Presumably nothing in this framework actually depends on iOS - could you possibly mark the podspec as being compatible with OSX too? pod refuses to install it simply because I'm targeting OSX :)

Issue with testing func with a closure parameter

Greetings!
Have a some problems with testing func, which have call function with a closure parameter inside
MVP architecture, testing non-mock Presenter with mocked ViewController
Presenter - func chooseTypeOfPurpose() {
view.showCategory(purposes: purposes, currentPurpose: currentPurpose) { (otherCategory) in
if let category = otherCategory {
self.setCategory(category)
self.updateButtons()
}
}
}
MockViewController - func showCategory(purposes: [PurposeObject], currentPurpose: PurposeObject?, completion: @escaping (PurposeObject?) -> Void) {
let viewController = PurposeViewController()
viewController.purposeHandler = completion
viewController.allPurposes = purposes
viewController.currentPurpose = currentPurpose;
self.navigationController?.pushViewController(viewController, animated: true)
}
So, what i can do in this situation?
Can i handle completion with Mockit like in Mockito with argumentcaptor?

1.5.0 version unavailable on CocoaPods

Hello :)

I recently tried to install Mockit via CocoaPods with the following line :

pod 'Mockit', '1.5.0'

Unfortunately, I get the : None of your spec sources contain a spec satisfying the dependency: Mockit (= 1.5.0) error.

When I go to cocoa pods, the latest version is the 1.4.0 with a compilation error on MockMatcher line 33 (use public instead of open).

I will go with manual installation for now but it would be great if the latest version of the library could be available on Cocoapods for CI :)

Thanks in advance !

How to stub the same method twice with different arguments

Hi,
I need to stub the same method of my mockObject twice, but I can't use the variadic thenReturn because it's a generic method returning different types Single<T.Data> according to the T provided as an argument. (In the code above a Query is a protocol, and the method getSingle<T>(query: T) -> Single<T.Data> where T : Query accepts any class that implements query and returns a Single of type T.Data)

let _ = self.mockDataSource.when().call(withReturnValue: self.mockDataSource.getSingle(query: QueryA())) .thenReturn(Single.just(payloadA))

let _ = self.mockDataSource .when().call(withReturnValue: self.mockDataSource.getSingle(query: QueryB())) .thenReturn(Single.just(payloadB))

However, the second stub is never called, always the first one, and my tests fail. I'd like to have the ability to create a stub returning a specific type according to the type provided as an argument, either by matching the provided type (I failed to do it with ArgumentMatcher) either by specifying the order...

Thank you for your help,

Please release v1.3.3

Recently,i made changes for making the pod compatible with ios8.
Hence,please release new version of pod

Static mocking?

Hi,

Is it possible to "mock" a static object or its static functions with Mockit? If yes, how?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.