Browse Source

Fixes tests not compiling on the OS X target and adds a line for the .travis.yml so that tests are always ran

Vittorio Monaco 9 years ago
parent
commit
838b1238cd
2 changed files with 6 additions and 6 deletions
  1. 2 2
      .travis.yml
  2. 4 4
      Tests/Tests.swift

+ 2 - 2
.travis.yml

@@ -10,6 +10,6 @@ before_install:
   - gem install xcpretty -N
 script:
   - set -o pipefail
-  - xcodebuild -project SnapKit.xcodeproj -scheme "SnapKit iOS" -sdk iphonesimulator
-    -destination "platform=iOS Simulator,name=iPhone 6" ONLY_ACTIVE_ARCH=NO  test | xcpretty -c
+  - xcodebuild -project SnapKit.xcodeproj -scheme "SnapKit iOS" -sdk iphonesimulator -destination "platform=iOS Simulator,name=iPhone 6" ONLY_ACTIVE_ARCH=NO  test | xcpretty -c
+  - xcodebuild -project SnapKit.xcodeproj -scheme "SnapKit OSX" ONLY_ACTIVE_ARCH=YES test | xcpretty -c
   - pod lib lint --quick

+ 4 - 4
Tests/Tests.swift

@@ -282,11 +282,11 @@ class SnapKitTests: XCTestCase {
         XCTAssertEqual(constraints[0].secondAttribute, NSLayoutAttribute.Top, "Should be top")
         XCTAssertEqual(constraints[1].secondAttribute, NSLayoutAttribute.Bottom, "Should be bottom")
         
-        XCTAssertEqual(constraints[0].firstItem as? UIView, view, "Should be added subview")
-        XCTAssertEqual(constraints[1].firstItem as? UIView, view, "Should be added subview")
+        XCTAssertEqual(constraints[0].firstItem as? View, view, "Should be added subview")
+        XCTAssertEqual(constraints[1].firstItem as? View, view, "Should be added subview")
         
-        XCTAssertEqual(constraints[0].secondItem as? UIView, container, "Should be containerView")
-        XCTAssertEqual(constraints[1].secondItem as? UIView, container, "Should be containerView")
+        XCTAssertEqual(constraints[0].secondItem as? View, container, "Should be containerView")
+        XCTAssertEqual(constraints[1].secondItem as? View, container, "Should be containerView")
         
         XCTAssertEqual(constraints[0].constant, 10, "Should be 10")
         XCTAssertEqual(constraints[1].constant, -10, "Should be 10")