Skip to content

Commit

Permalink
doc: added exclude documentation case
Browse files Browse the repository at this point in the history
  • Loading branch information
amichnia committed Jan 8, 2018
1 parent 856bcb7 commit 6a8aef5
Show file tree
Hide file tree
Showing 65 changed files with 2,357 additions and 276 deletions.
2 changes: 2 additions & 0 deletions .jazzy.yaml
Expand Up @@ -37,3 +37,5 @@ custom_categories:
- Perform(_:_:)
- Verify(_:_:file:line:)
- Verify(_:_:_:file:line:)
- VerifyProperty(_:_:file:line:)
- VerifyProperty(_:_:_:file:line:)
9 changes: 6 additions & 3 deletions .mocky.iOS.yml
@@ -1,7 +1,10 @@
sources:
- ./SwiftyMocky-Example/Shared
- ./SwiftyMocky-Example/iOS
- ./SwiftyMocky-Tests/iOS
include:
- ./SwiftyMocky-Example/Shared
- ./SwiftyMocky-Example/iOS
- ./SwiftyMocky-Tests/iOS
exclude:
- ./SwiftyMocky-Example/Shared/Other/Excluded.generated.swift
templates:
- ./Sources/Templates
output:
Expand Down
9 changes: 6 additions & 3 deletions .mocky.macOS.yml
@@ -1,7 +1,10 @@
sources:
- ./SwiftyMocky-Example/Shared
- ./SwiftyMocky-Example/macOS
- ./SwiftyMocky-Tests/macOS
include:
- ./SwiftyMocky-Example/Shared
- ./SwiftyMocky-Example/macOS
- ./SwiftyMocky-Tests/macOS
exclude:
- ./SwiftyMocky-Example/Shared/Other/Excluded.generated.swift
templates:
- ./Sources/Templates
output:
Expand Down
9 changes: 6 additions & 3 deletions .mocky.tvOS.yml
@@ -1,7 +1,10 @@
sources:
- ./SwiftyMocky-Example/Shared
- ./SwiftyMocky-Example/tvOS
- ./SwiftyMocky-Tests/tvOS
include:
- ./SwiftyMocky-Example/Shared
- ./SwiftyMocky-Example/tvOS
- ./SwiftyMocky-Tests/tvOS
exclude:
- ./SwiftyMocky-Example/Shared/Other/Excluded.generated.swift
templates:
- ./Sources/Templates
output:
Expand Down
8 changes: 8 additions & 0 deletions Mocky.xcodeproj/project.pbxproj
Expand Up @@ -12,6 +12,9 @@
61B65D431C6E4154C44B6B1D /* Pods_Mocky_Example_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9D435D6B1D3850EB6C36B69E /* Pods_Mocky_Example_iOS.framework */; };
6A629255223ACC1B05F1B6D7 /* Pods_Mocky_Tests_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 835A7223A01A944E0F3E0BCF /* Pods_Mocky_Tests_macOS.framework */; };
7D1174B528873ECD259B355C /* Pods_Mocky_Example_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 356426D9A4F6925FCD6469A5 /* Pods_Mocky_Example_tvOS.framework */; };
CC3252172003CC22009AD6C2 /* Excluded.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3252162003CC22009AD6C2 /* Excluded.generated.swift */; };
CC3252182003CC22009AD6C2 /* Excluded.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3252162003CC22009AD6C2 /* Excluded.generated.swift */; };
CC3252192003CC22009AD6C2 /* Excluded.generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC3252162003CC22009AD6C2 /* Excluded.generated.swift */; };
CC491A1B1FD9A33F001CAB8A /* Countable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC491A1A1FD9A33F001CAB8A /* Countable.swift */; };
CC491A1F1FDAB4BA001CAB8A /* ProtocolWithProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC491A1D1FDAB4AB001CAB8A /* ProtocolWithProperties.swift */; };
CC491A201FDAB4BB001CAB8A /* ProtocolWithProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC491A1D1FDAB4AB001CAB8A /* ProtocolWithProperties.swift */; };
Expand Down Expand Up @@ -172,6 +175,7 @@
AAEE52510F67C7DF13FF8AF2 /* Pods-Mocky_Example_tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mocky_Example_tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Mocky_Example_tvOS/Pods-Mocky_Example_tvOS.debug.xcconfig"; sourceTree = "<group>"; };
BCB5C12EDA17046011396E79 /* Pods-Mocky_Tests_tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Mocky_Tests_tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Mocky_Tests_tvOS/Pods-Mocky_Tests_tvOS.debug.xcconfig"; sourceTree = "<group>"; };
CAC0C2FE2E105DB67A93DC7E /* Pods_Mocky_Example_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Mocky_Example_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; };
CC3252162003CC22009AD6C2 /* Excluded.generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Excluded.generated.swift; sourceTree = "<group>"; };
CC491A1A1FD9A33F001CAB8A /* Countable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Countable.swift; sourceTree = "<group>"; };
CC491A1D1FDAB4AB001CAB8A /* ProtocolWithProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProtocolWithProperties.swift; sourceTree = "<group>"; };
CC491A231FDAB583001CAB8A /* ProtocolWithPropertiesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProtocolWithPropertiesTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -504,6 +508,7 @@
CCE350D41FCC0A9400A76C4C /* ItemsRepository.swift */,
CCE350D51FCC0A9400A76C4C /* GenericProtocols.swift */,
CCE350D61FCC0A9400A76C4C /* SampleService.swift */,
CC3252162003CC22009AD6C2 /* Excluded.generated.swift */,
);
path = Other;
sourceTree = "<group>";
Expand Down Expand Up @@ -1311,6 +1316,7 @@
files = (
CCE350FE1FCC0A9400A76C4C /* Models.swift in Sources */,
CCE350FC1FCC0A9400A76C4C /* Item.swift in Sources */,
CC3252182003CC22009AD6C2 /* Excluded.generated.swift in Sources */,
CCE350EE1FCC0A9400A76C4C /* ItemsRepository.swift in Sources */,
CCE351021FCC0A9400A76C4C /* ProtocolsWithCustomAttributes.swift in Sources */,
CCE350F81FCC0A9400A76C4C /* ProtocolsWithCollections.swift in Sources */,
Expand Down Expand Up @@ -1358,6 +1364,7 @@
files = (
CCE350FD1FCC0A9400A76C4C /* Models.swift in Sources */,
CCE350FB1FCC0A9400A76C4C /* Item.swift in Sources */,
CC3252172003CC22009AD6C2 /* Excluded.generated.swift in Sources */,
CCE350ED1FCC0A9400A76C4C /* ItemsRepository.swift in Sources */,
CCE351011FCC0A9400A76C4C /* ProtocolsWithCustomAttributes.swift in Sources */,
CCE350F71FCC0A9400A76C4C /* ProtocolsWithCollections.swift in Sources */,
Expand Down Expand Up @@ -1404,6 +1411,7 @@
files = (
CC5B61D81FCC18C4007FB209 /* ExampleProtocols.swift in Sources */,
CC5B61D11FCC18C4007FB209 /* ProtocolWithStaticMembers.swift in Sources */,
CC3252192003CC22009AD6C2 /* Excluded.generated.swift in Sources */,
CC5B61C11FCC1764007FB209 /* AppDelegate.swift in Sources */,
CC5B61DA1FCC18C4007FB209 /* GenericProtocols.swift in Sources */,
CC5B61D01FCC18C4007FB209 /* ProtocolsWithCustomAttributes.swift in Sources */,
Expand Down
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -104,8 +104,9 @@ First, create file in your project root directory with following structure:

```yml
sources:
- ./ExampleApp
- ./ExampleAppTests
include:
- ./ExampleApp
- ./ExampleAppTests
templates:
- ./Pods/SwiftyMocky/Sources/Templates
output:
Expand All @@ -123,7 +124,7 @@ args:
- vertical_whitespace
```

+ **sources**: all directories you want to scan for protocols/files marked to be auto mocked, or inline mocked
+ **sources**: all directories you want to scan for protocols/files marked to be auto mocked, or inline mocked. You can use `exclude`, to prevent from scanning particular files (makes sense for big `*.generated.swift` files)
+ **templates**: path to SwiftyMocky sourcery templates, in Pods directory
+ **output**: place where `Mock.generated.swift` will be placed
+ **testable**: specify imports for Mock.generated, that should be marked as `@testable` (usually tested app module)
Expand Down
14 changes: 14 additions & 0 deletions SwiftyMocky-Example/Shared/Other/Excluded.generated.swift
@@ -0,0 +1,14 @@
//
// Excluded.generated.swift
// Mocky
//
// Created by Andrzej Michnia on 08.01.2018.
// Copyright © 2018 CocoaPods. All rights reserved.
//

import Foundation

//sourcery: AutoMockable
protocol ProtocolNotToBeMocked {

}
3 changes: 3 additions & 0 deletions SwiftyMocky-Tests/Shared/Example 1/SimpleProtocolsTests.swift
Expand Up @@ -175,6 +175,9 @@ class SimpleProtocolsTests: XCTestCase {
func test_simpleProtocol_that_inherits() {
let mock = SimpleProtocolThatInheritsOtherProtocolsMock()

XCTAssert(mock is SimpleProtocolWithProperties)
XCTAssert(mock is SimpleProtocolWithMethods)

Verify(mock, 0, .simpleMethod()) // Should be 0

mock.simpleMethod()
Expand Down
2 changes: 1 addition & 1 deletion SwiftyMocky-Tests/iOS/Mocks/Mock.generated.swift
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.10.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.9.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down
2 changes: 1 addition & 1 deletion SwiftyMocky-Tests/macOS/Mocks/Mock.generated.swift
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.10.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.9.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down
2 changes: 1 addition & 1 deletion SwiftyMocky-Tests/tvOS/Mocks/Mock.generated.swift
@@ -1,4 +1,4 @@
// Generated using Sourcery 0.10.0 — https://github.com/krzysztofzablocki/Sourcery
// Generated using Sourcery 0.9.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT


Expand Down
24 changes: 21 additions & 3 deletions docs/Classes/Matcher.html
Expand Up @@ -14,7 +14,7 @@
<a title="Matcher Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftyMocky Docs</a> (71% documented)</p>
<p><a href="../index.html">SwiftyMocky Docs</a> (67% documented)</p>
<p class="header-right"><a href="https://github.com/MakeAWishFoundation/SwiftyMocky"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -108,10 +108,22 @@
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_06StaticC0Qzs0D6StringV4fileSu4linetAA0D4MockRzlF">Verify(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyx_SuABQzs12StaticStringV4fileSu4linetAA4MockRzlF">Verify(_:_:_:file:line:)</a>
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyx_AA5CountVABQzs12StaticStringV4fileSu4linetAA4MockRzlF">Verify(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_Su06StaticC0Qzs0D6StringV4fileSu4linetAA0D4MockRzlF">Verify(_:_:_:file:line:)</a>
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_AA5CountV06StaticC0Qzs0E6StringV4fileSu4linetAA0E4MockRzlF">Verify(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyx_0D0Qzs12StaticStringV4fileSu4linetAA4MockRzlF">VerifyProperty(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyxm_06StaticD0Qzs0E6StringV4fileSu4linetAA0E4MockRzlF">VerifyProperty(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyx_AA5CountV0D0Qzs12StaticStringV4fileSu4linetAA4MockRzlF">VerifyProperty(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyxm_AA5CountV06StaticD0Qzs0F6StringV4fileSu4linetAA0F4MockRzlF">VerifyProperty(_:_:_:file:line:)</a>
</li>
</ul>
</li>
Expand All @@ -126,9 +138,15 @@
<li class="nav-group-name">
<a href="../Other Extensions.html">Other Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Other Extensions.html#/s:Si">Int</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/Optional.html">Optional</a>
</li>
<li class="nav-group-task">
<a href="../Other Extensions.html#/s:Su">UInt</a>
</li>
</ul>
</li>
<li class="nav-group-name">
Expand Down
24 changes: 21 additions & 3 deletions docs/Enums/Parameter.html
Expand Up @@ -14,7 +14,7 @@
<a title="Parameter Enum Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftyMocky Docs</a> (71% documented)</p>
<p><a href="../index.html">SwiftyMocky Docs</a> (67% documented)</p>
<p class="header-right"><a href="https://github.com/MakeAWishFoundation/SwiftyMocky"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -108,10 +108,22 @@
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_06StaticC0Qzs0D6StringV4fileSu4linetAA0D4MockRzlF">Verify(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyx_SuABQzs12StaticStringV4fileSu4linetAA4MockRzlF">Verify(_:_:_:file:line:)</a>
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyx_AA5CountVABQzs12StaticStringV4fileSu4linetAA4MockRzlF">Verify(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_Su06StaticC0Qzs0D6StringV4fileSu4linetAA0D4MockRzlF">Verify(_:_:_:file:line:)</a>
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_AA5CountV06StaticC0Qzs0E6StringV4fileSu4linetAA0E4MockRzlF">Verify(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyx_0D0Qzs12StaticStringV4fileSu4linetAA4MockRzlF">VerifyProperty(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyxm_06StaticD0Qzs0E6StringV4fileSu4linetAA0E4MockRzlF">VerifyProperty(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyx_AA5CountV0D0Qzs12StaticStringV4fileSu4linetAA4MockRzlF">VerifyProperty(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyxm_AA5CountV06StaticD0Qzs0F6StringV4fileSu4linetAA0F4MockRzlF">VerifyProperty(_:_:_:file:line:)</a>
</li>
</ul>
</li>
Expand All @@ -126,9 +138,15 @@
<li class="nav-group-name">
<a href="../Other Extensions.html">Other Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Other Extensions.html#/s:Si">Int</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/Optional.html">Optional</a>
</li>
<li class="nav-group-task">
<a href="../Other Extensions.html#/s:Su">UInt</a>
</li>
</ul>
</li>
<li class="nav-group-name">
Expand Down
24 changes: 21 additions & 3 deletions docs/Extensions/Optional.html
Expand Up @@ -14,7 +14,7 @@
<a title="Optional Extension Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftyMocky Docs</a> (71% documented)</p>
<p><a href="../index.html">SwiftyMocky Docs</a> (67% documented)</p>
<p class="header-right"><a href="https://github.com/MakeAWishFoundation/SwiftyMocky"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -108,10 +108,22 @@
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_06StaticC0Qzs0D6StringV4fileSu4linetAA0D4MockRzlF">Verify(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyx_SuABQzs12StaticStringV4fileSu4linetAA4MockRzlF">Verify(_:_:_:file:line:)</a>
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyx_AA5CountVABQzs12StaticStringV4fileSu4linetAA4MockRzlF">Verify(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_Su06StaticC0Qzs0D6StringV4fileSu4linetAA0D4MockRzlF">Verify(_:_:_:file:line:)</a>
<a href="../Global methods.html#/s:11SwiftyMocky6Verifyyxm_AA5CountV06StaticC0Qzs0E6StringV4fileSu4linetAA0E4MockRzlF">Verify(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyx_0D0Qzs12StaticStringV4fileSu4linetAA4MockRzlF">VerifyProperty(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyxm_06StaticD0Qzs0E6StringV4fileSu4linetAA0E4MockRzlF">VerifyProperty(_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyx_AA5CountV0D0Qzs12StaticStringV4fileSu4linetAA4MockRzlF">VerifyProperty(_:_:_:file:line:)</a>
</li>
<li class="nav-group-task">
<a href="../Global methods.html#/s:11SwiftyMocky14VerifyPropertyyxm_AA5CountV06StaticD0Qzs0F6StringV4fileSu4linetAA0F4MockRzlF">VerifyProperty(_:_:_:file:line:)</a>
</li>
</ul>
</li>
Expand All @@ -126,9 +138,15 @@
<li class="nav-group-name">
<a href="../Other Extensions.html">Other Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Other Extensions.html#/s:Si">Int</a>
</li>
<li class="nav-group-task">
<a href="../Extensions/Optional.html">Optional</a>
</li>
<li class="nav-group-task">
<a href="../Other Extensions.html#/s:Su">UInt</a>
</li>
</ul>
</li>
<li class="nav-group-name">
Expand Down

0 comments on commit 6a8aef5

Please sign in to comment.