Skip to content

Commit

Permalink
[SwiftLint] Address trailing_whitespace violations
Browse files Browse the repository at this point in the history
  • Loading branch information
ospina-gonzalez authored and dennisweissmann committed Jul 26, 2017
1 parent aa4e312 commit c641f12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
4 changes: 1 addition & 3 deletions Source/Device.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,8 @@ public enum Device {
public var localizedModel: String {
return UIDevice.current.localizedModel
}

/// PPI (Pixels per Inch) on the current device's screen (if applicable). When not applicable the property returns nil.

public var ppi: Int? {
#if os(iOS)
switch self {
Expand All @@ -380,7 +379,6 @@ public enum Device {
return nil
#endif
}

}

// MARK: - CustomStringConvertible
Expand Down
17 changes: 4 additions & 13 deletions Tests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,15 @@ class DeviceKitTests: XCTestCase {
func testIsPad() {
Device.allPads.forEach { XCTAssertTrue($0.isPad) }
}

/// * Test that all the ppi values for applicable devices match the public information available at wikipedia.
/// * Test non-applicable devices return nil.

/// Test that all the ppi values for applicable devices match the public information available at wikipedia. Test non-applicable devices return nil.
func testPPI() {
// Devices

// IPods
// source: https://en.wikipedia.org/wiki/IPod_Touch_(5th_generation)
XCTAssertEqual(Device.iPodTouch5.ppi, 326)
// source: https://en.wikipedia.org/wiki/IPod_Touch_(6th_generation)
XCTAssertEqual(Device.iPodTouch5.ppi, 326)

// Iphones
// source: https://en.wikipedia.org/wiki/IPhone_4
XCTAssertEqual(Device.iPhone4.ppi, 326)
Expand All @@ -248,7 +245,6 @@ class DeviceKitTests: XCTestCase {
XCTAssertEqual(Device.iPhone7Plus.ppi, 401)
// source: https://en.wikipedia.org/wiki/IPhone_SE
XCTAssertEqual(Device.iPhoneSE.ppi, 326)

// Ipads
// source: https://en.wikipedia.org/wiki/IPad_2
XCTAssertEqual(Device.iPad2.ppi, 132)
Expand Down Expand Up @@ -278,9 +274,7 @@ class DeviceKitTests: XCTestCase {
XCTAssertEqual(Device.iPadPro12Inch2.ppi, 264)
// source: https://en.wikipedia.org/wiki/IPad_Pro
XCTAssertEqual(Device.iPadPro10Inch.ppi, 264)

// Non-applicable devices:

// Simulators
XCTAssertEqual(Device.simulator(Device.iPhone4).ppi, nil)
XCTAssertEqual(Device.simulator(Device.iPhone4s).ppi, nil)
Expand Down Expand Up @@ -321,15 +315,12 @@ class DeviceKitTests: XCTestCase {
func testDescriptionFromIdentifier() {
XCTAssertEqual(Device.mapToDevice(identifier: "AppleTV5,3").description, "Apple TV 4")
}

/// * Test that all the ppi values for applicable devices match the public information available at wikipedia.
/// * Test non-applicable devices return nil.

/// Test that all the ppi values for applicable devices match the public information available at wikipedia. Test non-applicable devices return nil.
func testPPI() {
// Non-applicable devices:

// Apple TV
XCTAssertEqual(Device.appleTV4.ppi, nil)

// Simulators
XCTAssertEqual(Device.simulator(Device.appleTV4).ppi, nil)
}
Expand Down

0 comments on commit c641f12

Please sign in to comment.