Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Commit 38e6961

Browse files
committed
Merge branch 'master' into develop
2 parents 18c96ff + 2308937 commit 38e6961

File tree

6 files changed

+64
-5
lines changed

6 files changed

+64
-5
lines changed

Codemine.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "Codemine"
19-
s.version = "0.1.0"
19+
s.version = "1.0.1"
2020
s.summary = "A gold mine of code, filled with neat utility functions."
2121

2222
# This description is used to generate tags and improve search results.
@@ -133,4 +133,4 @@ Pod::Spec.new do |s|
133133
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
134134
# s.dependency "JSONKit", "~> 1.4"
135135

136-
end
136+
end

Codemine.xcodeproj/project.pbxproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
83A5BEC91D98249500C74312 /* URLImageAssetSizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A5BEC81D98249500C74312 /* URLImageAssetSizeTests.swift */; };
7777
83A5BECA1D98249500C74312 /* URLImageAssetSizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A5BEC81D98249500C74312 /* URLImageAssetSizeTests.swift */; };
7878
83A5BECB1D98249500C74312 /* URLImageAssetSizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83A5BEC81D98249500C74312 /* URLImageAssetSizeTests.swift */; };
79+
9F4A1BBE1F97AF0F00154997 /* XCTestCase+Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F4A1BBD1F97AF0F00154997 /* XCTestCase+Utilities.swift */; };
7980
8C9AAA2F1F4ED1F000F9E7C9 /* URLParameterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C9AAA2E1F4ED1F000F9E7C9 /* URLParameterTests.swift */; };
8081
/* End PBXBuildFile section */
8182

@@ -135,6 +136,7 @@
135136
83A5BEBF1D98226800C74312 /* add.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = add.png; sourceTree = "<group>"; };
136137
83A5BEC31D98228300C74312 /* alert.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = alert.png; sourceTree = "<group>"; };
137138
83A5BEC81D98249500C74312 /* URLImageAssetSizeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLImageAssetSizeTests.swift; sourceTree = "<group>"; };
139+
9F4A1BBD1F97AF0F00154997 /* XCTestCase+Utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+Utilities.swift"; sourceTree = "<group>"; };
138140
8C9AAA2E1F4ED1F000F9E7C9 /* URLParameterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLParameterTests.swift; sourceTree = "<group>"; };
139141
/* End PBXFileReference section */
140142

@@ -232,6 +234,7 @@
232234
275BCAAD1C57D1B500FF3647 /* CodemineTests */ = {
233235
isa = PBXGroup;
234236
children = (
237+
9F4A1BBC1F97AEE700154997 /* Extensions */,
235238
83A5BEC71D98228F00C74312 /* Resources */,
236239
275BCAB01C57D1B500FF3647 /* Info.plist */,
237240
275BCAAE1C57D1B500FF3647 /* CodemineTests.swift */,
@@ -280,6 +283,14 @@
280283
name = Resources;
281284
sourceTree = "<group>";
282285
};
286+
9F4A1BBC1F97AEE700154997 /* Extensions */ = {
287+
isa = PBXGroup;
288+
children = (
289+
9F4A1BBD1F97AF0F00154997 /* XCTestCase+Utilities.swift */,
290+
);
291+
path = Extensions;
292+
sourceTree = "<group>";
293+
};
283294
/* End PBXGroup section */
284295

285296
/* Begin PBXHeadersBuildPhase section */
@@ -661,6 +672,7 @@
661672
files = (
662673
291D23001E0425BF003E1210 /* DispatchTimeTests.swift in Sources */,
663674
83A5BEC91D98249500C74312 /* URLImageAssetSizeTests.swift in Sources */,
675+
9F4A1BBE1F97AF0F00154997 /* XCTestCase+Utilities.swift in Sources */,
664676
8C9AAA2F1F4ED1F000F9E7C9 /* URLParameterTests.swift in Sources */,
665677
275BCAAF1C57D1B500FF3647 /* CodemineTests.swift in Sources */,
666678
83A5BEBC1D981F3500C74312 /* UIImageTests.swift in Sources */,

Codemine.xcodeproj/xcshareddata/xcschemes/Codemine.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES"
30-
codeCoverageEnabled = "YES">
30+
codeCoverageEnabled = "NO">
3131
<Testables>
3232
<TestableReference
3333
skipped = "NO">

CodemineTests/CodemineTests.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,19 @@ class CodemineTests: XCTestCase {
198198
let error2 = NSError(domain: domain, code: code, userInfo: [NSLocalizedDescriptionKey : description])
199199
XCTAssertEqual(error, error2)
200200
}
201+
202+
// MARK: - XCTestCase extension test
203+
func testThrowsSpecificError() {
204+
//Sample types
205+
enum MyError: Error {
206+
case specificError
207+
}
208+
209+
func throwIt() throws {
210+
throw MyError.specificError
211+
}
212+
213+
//Actually test
214+
XCTAssertThrows(try throwIt(), specificError: MyError.specificError)
215+
}
201216
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// XCTestCase+Utilities.swift
3+
// Codemine
4+
//
5+
// Created by HE:labs on 18/10/17.
6+
// Copyright © 2017 Nodes. All rights reserved.
7+
//
8+
9+
import XCTest
10+
11+
extension XCTestCase {
12+
func XCTAssertThrows<T, E>(_ expression: @autoclosure () throws -> T, specificError: E) where E: Error, E: Equatable {
13+
14+
XCTAssertThrowsError(try expression()) { error in
15+
XCTAssertEqual(error as? E, specificError)
16+
}
17+
18+
}
19+
}

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@ Codemine is a collection of extensions containing useful functions and syntactic
2020

2121
## 📦 Installation
2222

23+
### CocoaPods
24+
25+
If you are using CocoaPods add this text to your Podfile and run `pod install`.
26+
~~~
27+
pod 'Codemine', '~>1.0.0'
28+
29+
# Swift 2.3
30+
pod 'Codemine', '~>0.2.5'
31+
32+
# Swift 2.2
33+
pod 'Codemine', '~>0.2.2'
34+
~~~
35+
2336
### Carthage
2437
~~~
2538
github "nodes-ios/Codemine" ~> 1.0
@@ -105,7 +118,7 @@ This method appends the `size` multiplied by `UIScreen.main.scale` to an asset u
105118
```swift
106119
let camelCaseStr1 = "userId"
107120
let camelCaseStr2 = "isUserActiveMemberOfCurrentGroup"
108-
121+
109122
print(camelCaseStr1.camelCaseToUnderscore()) // "user_id"
110123
print(camelCaseStr2.camelCaseToUnderscore()) // "is_user_active_member_of_current_group"
111124
```
@@ -164,7 +177,7 @@ DispatchQueue.main.asyncAfter(deadline: 5) { /* ... */ }
164177
```
165178

166179
## 👥 Credits
167-
Made with ❤️ at [Nodes](http://nodesagency.com).
180+
Made with ❤️ at [Nodes](http://nodesagency.com).
168181

169182
`Application` and `Then` were borrowed from Hyper's [Sugar](https://github.com/hyperoslo/Sugar) 🙈.
170183

0 commit comments

Comments
 (0)