evermeer / AlamofireJsonToObjects

An Alamofire extension which converts JSON response data into swift objects using EVReflection
Other
161 stars 28 forks source link

Response class module problem #23

Closed kerem1905 closed 8 years ago

kerem1905 commented 8 years ago

Using latest version, when i run application target everything works fine. But I added Test target to the project (Quick&Nimble) and tried to run test target, the problem is: req.responseObject { (response: Result<T, NSError>) in if let result = response.value {

I have single response class that belongs to two target (app and test).
Even T is type of class belongs to Test module, result objects class is belongs to app target class. It seems like you convert result class regardless of module check.

evermeer commented 8 years ago

As you can see in the testclasses in the EVReflection project, you can specify one or multiple bundles that will then be used to create objects. When you have your object classes in only one bundle, then you can make sure the correct bundel is used with code like this:

    override func setUp() {
        super.setUp()
        EVReflection.setBundleIdentifier(TestObject)
    }

If you want to use classes from multiple bundles, then you can use:

EVReflection.setBundleIdentifiers([TestObject, TestObjectFromBundle2])