Comments (5)
Yes, i am using latest commit. I was able to create project where this bug reproduces:
alvarhansen@62b6889
MyFramework2 demonstrates the bug and MyFramework3 shows how it should work.
In MyFramework2Mocks.generated.swift
ViewModelView2Mock
has empty
InitializerProxy
which is incorrect. Instead it should have
fileprivate init(sourceLocation: Mockingbird.SourceLocation)
as can
be seen in MyFramework3Mocks.generated.swift
from mockingbird.
Thanks for reporting, Alvar. A few questions:
- In your example are
MyProtocol1
andMyProtocol2
in the same module asMyVC
? - Are you including the default supporting source files for
UIViewController
?
from mockingbird.
- No.
MyVC.swift
andMyProtocol2.swift
are in one framework andMyProtocol1.swift
in separate framework. - Yes, the supporting files are included and are working for other mocked types in this framework.
The issue seems to be that MyVC.swift
and MyProtocol2.swift
do not import Foundations, and because of that Swift Foundation support is never used when resolving inherited types at https://github.com/birdrides/mockingbird/blob/78707c9544d78535e68223e46fabdbb07b1ae3ab/MockingbirdGenerator/Parser/Operations/FlattenInheritanceOperation.swift#L111
from mockingbird.
Just to check, are you on 0.9.0 (your branch seems to still be on 0.8.0)? I think this might be fixed by #19. Can you update and see if that solves it?
from mockingbird.
Thanks! Definitely similar to the previous issue you found except across modules (versus files within the same module).
from mockingbird.
Related Issues (20)
- warning: no calls to throwing functions occur within 'try'
- forwardCallsToSuper on class method
- Generator fails to create mock for the simplest PAT
- Missing or confusing documentation HOT 1
- Unable to stub closure in static function HOT 1
- Mocking URLSession with different URL parameters and responses
- Mock generator ignores class-only protocols HOT 3
- Exception on line with given on MacOS 13.2 and XCode 14.2 HOT 3
- Is mockingbird still being maintained?? HOT 2
- Unable to resolve inherited type 'AnyObject' HOT 3
- Mock doesn't work when created in setup method HOT 1
- Mock async and throwing properties
- Excluding file mechanism not working (on a custom Swift Package) HOT 3
- Mockingbird doesn't work out of the box on new projects and Xcode 15 due to sandboxing
- Always getting "Use of protocol 'CaseIterableDefaultsLast' as a type must be written 'any CaseIterableDefaultsLast'" Compiler Error
- Privacy Manifest
- Not generating any mocks results
- 'mock' is unavailable when mocking public protocols from other module HOT 2
- Error using function `any(_:of:)` when closure use generic types
- Supporting Source Files don't allow mocking of external types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mockingbird.