Skip to content

Commit

Permalink
Merge pull request #2 from StyleShare/testables
Browse files Browse the repository at this point in the history
Rename 'testable' with 'testables'
  • Loading branch information
devxoul authored Aug 25, 2019
2 parents c5666e3 + 0040c53 commit fec1603
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ And update the test code:
viewController.username = "devxoul"

// then
let usernameLabel = viewController.testable[\.usernameLabel] //
let usernameLabel = viewController.testables[\.usernameLabel] //
XCTAssertEqual(usernameLabel.text, "devxoul")
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public protocol Testable {
}

public extension Testable {
var testable: TestableKeys {
var testables: TestableKeys {
return TestableKeys.init(base: self)
}
}
8 changes: 4 additions & 4 deletions Tests/TestablesTests/ProfileViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ final class ProfileViewControllerTests: XCTestCase {
self.viewController.username = "devxoul"

// then
let usernameLabel = self.viewController.testable[\.usernameLabel]
let usernameLabel = self.viewController.testables[\.usernameLabel]
XCTAssertEqual(usernameLabel.text, "devxoul")
}

func testFollowButton_isSelected() {
// when
self.viewController.testable[\.isFollowing] = true
self.viewController.testables[\.isFollowing] = true

// then
let followButton = self.viewController.testable[\.followButton]
let followButton = self.viewController.testables[\.followButton]
XCTAssertTrue(followButton.isSelected)
XCTAssertTrue(self.viewController.testable[\.isFollowing])
XCTAssertTrue(self.viewController.testables[\.isFollowing])
}
}

0 comments on commit fec1603

Please sign in to comment.