Skip to content

Commit 22433db

Browse files
committed
Merge branch 'master' of https://github.com/skyweb07/Snap into develop
2 parents 030c17a + ff2f6f4 commit 22433db

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</p>
44
<h1 align="center">Snap.swift - Snapshot testing in a snap 🎨</h1>
55
<p align="center">
6-
<img src="https://travis-ci.org/skyweb07/Snap.swift.svg?branch=feature%2Fintegrate-tracis-ci"/>
6+
<img src="https://travis-ci.org/skyweb07/Snap.swift.svg?branch=develop"/>
77
<img src="https://img.shields.io/badge/Swift-4.0-orange.svg" />
88
<a href="https://twitter.com/skyweb07">
99
<img src="https://img.shields.io/badge/contact-@skyweb07-blue.svg?style=flat" alt="Twitter: @skyweb07" />
@@ -18,11 +18,12 @@
1818
### 🤖 Requirements
1919

2020
* iOS 9.0+
21+
* tvOS 10.0+
2122
* Xcode 9.0+
2223
* Swift / Objective-C
2324

2425

25-
### 🚀 Getting started
26+
### 🚀 Getting started
2627

2728
### 🎨 Why test the UI?
2829
You want to make sure that every time you touch any of your UI elements everything stays as they way they were meant to be, also this kind of integration test help you achieve the pixel perfect views and make your designers happy by having design reference images that they can see even in your pull requests.
@@ -31,7 +32,7 @@ You want to make sure that every time you touch any of your UI elements everythi
3132
Works by generating a reference image that gets stored in your repository and then comparing each new test case with the `reference image` to check if there are any differences. If test found any differences it will add an attachment into your test case and you'll be able to check what changed
3233

3334
![Project attachment](.art/xcode_attachment.png)
34-
35+
3536
### 🛠 Configuration
3637

3738
In order to configure the snapshot test folder, we need to add a new environment variable to the project with name `SNAP_REFERENCE_IMAGE_PATH` and value `$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/` so `Snap.swift` can find the folder to store the reference images. If the configuration was correctly set the project should look like this:
@@ -49,7 +50,7 @@ it, simply add the following line to your Podfile:
4950
pod 'Snap.swift'
5051
```
5152

52-
### ✅ Creating our first test
53+
### ✅ Creating our first test
5354

5455
1) We first need to record our reference images, in order to do so we have to first go into our test class and set the `isRecording` variable to be `true` so the library knows that we are in record mode and can extract the `reference images`
5556

@@ -60,15 +61,15 @@ import XCTest
6061
import Snap_swift
6162

6263
class SnapTests: XCTestCase {
63-
64+
6465
override func setUp() {
6566
super.setUp()
6667
isRecording = true
6768
}
6869

6970
func test_box_with_text_aligned_to_center() {
7071
let view = BoxWithTextAlignedToCenterView()
71-
72+
7273
expect(view).toMatchSnapshot()
7374
}
7475
}
@@ -93,7 +94,7 @@ class SnapTests: XCTestCase {
9394
- (void)test_box_with_text_aligned_to_center {
9495

9596
UIView *view = [BoxWithTextAlignedToCenterView new];
96-
97+
9798
verifyView(view);
9899
}
99100

@@ -122,9 +123,9 @@ This is ok, it just means that our reference images were saved, we can inspect t
122123

123124
> As today, you can make assertions on `UIView` and `CALayer` classes.
124125
125-
This project is highly inspired on `Facebook` [FBSnapshotTestCase](https://github.com/facebookarchive/ios-snapshot-test-case/) library, it seems that they had archived the library so I started this one to continue envolving the project and continue with mobile `snapshot-testing`
126+
This project is highly inspired on `Facebook` [FBSnapshotTestCase](https://github.com/facebookarchive/ios-snapshot-test-case/) library, it seems that they had archived the library so I started this one to continue envolving the project and continue with mobile `snapshot-testing`
126127

127-
### 😬 Contributions
128+
### 😬 Contributions
128129
- Open an [issue](https://github.com/skyweb07/Snap.swift/issues/new)
129130
- Add suggestions or fix [issues](https://github.com/skyweb07/Snap.swift/issues) by opening PR's
130131
- Send me a message via [Twitter](https://twitter.com/skyweb07)

Snap.swift.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Pod::Spec.new do |s|
1414
s.social_media_url = 'https://twitter.com/skyweb07'
1515

1616
s.ios.deployment_target = '9.0'
17+
s.tvos.deployment_target = '10.0'
1718

1819
s.source_files = 'Snap/Core/**/*', 'Snap/Core/Infrastructure/Interoperability/*.h'
1920
s.frameworks = 'UIKit', 'CoreGraphics', 'XCTest'

0 commit comments

Comments
 (0)