Skip to content

Commit 1282e82

Browse files
Use @mockable(superclass: UIViewController) to fix Mockolo 2.6.1 protocol resolution
1 parent f8fdd77 commit 1282e82

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/genesis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
steps:
2121
- name: Install dependencies
2222
run: |
23-
brew install mint xcodegen needle
24-
mint install uber/mockolo@2.5.0
25-
sudo ln -sf ~/.mint/bin/mockolo /usr/local/bin/mockolo
23+
brew install mint xcodegen needle mockolo
2624
mint install yonaskolb/genesis
2725
- name: Checkout source
2826
uses: actions/checkout@v6

Sources/NodesGenerator/Resources/Stencils/Interface.stencil

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,12 @@ internal protocol {{ node_name }}Listener: AnyObject {}
2222
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
2323
/// presentation or containment as desired.
2424
{% if not view_controllable_mock_contents %}
25+
{% if view_controllable_type == "ViewControllable" %}
26+
/// @mockable(superclass: UIViewController)
27+
{% else %}
2528
/// @mockable
2629
{% endif %}
30+
{% endif %}
2731
@MainActor
2832
internal protocol {{ node_name }}ViewControllable: {{ view_controllable_type }} {}
2933
{% endif %}

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-Interface.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal protocol ___VARIABLE_productName___Listener: AnyObject {}
1414
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1515
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1616
/// presentation or containment as desired.
17-
/// @mockable
17+
/// @mockable(superclass: UIViewController)
1818
@MainActor
1919
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
2020

Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-Interface.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal protocol ___VARIABLE_productName___Listener: AnyObject {}
1414
/// Defines the interface between the `Flow` and its view in order to present or contain other views. This protocol
1515
/// typically inherits protocols that include pre-defined behavior for convenience. Add additional methods for custom
1616
/// presentation or containment as desired.
17-
/// @mockable
17+
/// @mockable(superclass: UIViewController)
1818
@MainActor
1919
internal protocol ___VARIABLE_productName___ViewControllable: ViewControllable {}
2020

0 commit comments

Comments
 (0)