Skip to content

Commit

Permalink
fix travis
Browse files Browse the repository at this point in the history
mats-claassen committed Oct 20, 2016
1 parent 9585ecf commit 5c34ca7
Showing 5 changed files with 18 additions and 18 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
language: objective-c
osx_image: xcode7.3
osx_image: xcode8
env:
- DESTINATION="OS=10.0,name=iPhone 6s" SCHEME="CreditCardRow" SDK=iphonesimulator10.0

before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
- if brew outdated | grep -qx xctool; then brew upgrade xctool; fi
- carthage update --platform iOS
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet

script:
- xctool clean build -project CreditCardRow.xcodeproj -scheme CreditCardRow -sdk iphonesimulator
- xctool test -project CreditCardRow.xcodeproj -scheme CreditCardRow -sdk iphonesimulator
- xcodebuild clean build -project CreditCardRow.xcodeproj -scheme "$SCHEME" -sdk "$SDK"
- xcodebuild -project CreditCardRow.xcodeproj -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c
3 changes: 3 additions & 0 deletions CreditCardRow.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -188,6 +188,7 @@
};
28F828861C494B2C00330CF4 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0800;
};
};
};
@@ -425,6 +426,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
@@ -436,6 +438,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.xmartlabs.CreditCardRowTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CreditCardRow

<p align="left">
<a href="https://travis-ci.org/xmartlabs/CreditCardRow"><img src="https://travis-ci.org/EurekaCommunity/CreditCardRow.svg?branch=master" alt="Build status" /></a>
<a href="https://travis-ci.org/EurekaCommunity/CreditCardRow"><img src="https://travis-ci.org/EurekaCommunity/CreditCardRow.svg?branch=master" alt="Build status" /></a>
<img src="https://img.shields.io/badge/platform-iOS-blue.svg?style=flat" alt="Platform iOS" />
<a href="https://developer.apple.com/swift"><img src="https://img.shields.io/badge/swift3-compatible-4BC51D.svg?style=flat" alt="Swift 2 compatible" /></a>
<a href="https://github.com/Carthage/Carthage"><img src="https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat" alt="Carthage compatible" /></a>
4 changes: 2 additions & 2 deletions Sources/CreditCardCell.swift
Original file line number Diff line number Diff line change
@@ -295,12 +295,12 @@ open class CreditCardCell: Cell<CreditCardInfo>, UITextFieldDelegate, CellType {
let expirationString = String(ccrow.expirationSeparator)
let cleanString = string.replacingOccurrences(of: expirationString, with: "", options: .literal, range: nil)
if cleanString.length >= 3 {
let monthString = cleanString[Range(uncheckedBounds: (lower: 0, upper: 2))]
let monthString = cleanString[Range(0...1)]
var yearString: String
if cleanString.length == 3 {
yearString = cleanString[2]
} else {
yearString = cleanString[Range(uncheckedBounds: (lower: 2, upper: 4))]
yearString = cleanString[Range(2...3)]
}
textField.text = monthString + expirationString + yearString
} else {
18 changes: 7 additions & 11 deletions Tests/CreditCardRowTests.swift
Original file line number Diff line number Diff line change
@@ -20,16 +20,12 @@ class CreditCardRowTests: XCTestCase {
super.tearDown()
}

func testExample() {
// This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results.
func testRangeHelpers() {
let testString = "abcdef"
XCTAssertEqual(testString[0], "a")
XCTAssertEqual(testString[3], "d")
XCTAssertEqual(testString[Range(0...1)], "ab")
XCTAssertEqual(testString[Range(3..<6)], "def")
}

func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock {
// Put the code you want to measure the time of here.
}
}

}
}

0 comments on commit 5c34ca7

Please sign in to comment.