Skip to content

Commit 286ce59

Browse files
author
Scott Baker
committed
Tests for file permission changes
1 parent e10a860 commit 286ce59

File tree

2 files changed

+88
-1
lines changed

2 files changed

+88
-1
lines changed

test/fixtures/file-perms.diff

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
diff --git a/circle.yml b/circle.yml
2+
old mode 100644
3+
new mode 100755
4+
diff --git a/foo.json b/foo.json
5+
new file mode 100644
6+
index 0000000..316a815
7+
--- /dev/null
8+
+++ b/foo.json
9+
@@ -0,0 +1,29 @@
10+
+{
11+
+ "name": "diff-so-fancy",
12+
+ "version": "0.5.1",
13+
+ "description": "Good-lookin' diffs with diff-highlight and more",
14+
+ "bin": {
15+
+ "diff-so-fancy": "diff-so-fancy",
16+
+ "diff-highlight": "third_party/diff-highlight/diff-highlight"
17+
+ },
18+
+ "repository": {
19+
+ "type": "git",
20+
+ "url": "git+https://github.com/so-fancy/diff-so-fancy.git"
21+
+ },
22+
+ "keywords": [
23+
+ "git",
24+
+ "diff",
25+
+ "fancy",
26+
+ "good-lookin'",
27+
+ "diff-highlight",
28+
+ "color",
29+
+ "readable",
30+
+ "highlight"
31+
+ ],
32+
+ "author": "Paul Irish",
33+
+ "license": "MIT",
34+
+ "bugs": {
35+
+ "url": "https://github.com/so-fancy/diff-so-fancy/issues"
36+
+ },
37+
+ "homepage": "https://github.com/so-fancy/diff-so-fancy#readme"
38+
+}
39+
diff --git a/package.json b/package.json
40+
deleted file mode 100644
41+
index 316a815..0000000
42+
--- a/package.json
43+
+++ /dev/null
44+
@@ -1,29 +0,0 @@
45+
-{
46+
- "name": "diff-so-fancy",
47+
- "version": "0.5.1",
48+
- "description": "Good-lookin' diffs with diff-highlight and more",
49+
- "bin": {
50+
- "diff-so-fancy": "diff-so-fancy",
51+
- "diff-highlight": "third_party/diff-highlight/diff-highlight"
52+
- },
53+
- "repository": {
54+
- "type": "git",
55+
- "url": "git+https://github.com/so-fancy/diff-so-fancy.git"
56+
- },
57+
- "keywords": [
58+
- "git",
59+
- "diff",
60+
- "fancy",
61+
- "good-lookin'",
62+
- "diff-highlight",
63+
- "color",
64+
- "readable",
65+
- "highlight"
66+
- ],
67+
- "author": "Paul Irish",
68+
- "license": "MIT",
69+
- "bugs": {
70+
- "url": "https://github.com/so-fancy/diff-so-fancy/issues"
71+
- },
72+
- "homepage": "https://github.com/so-fancy/diff-so-fancy#readme"
73+
-}

test/header_clean.bats

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ load 'test_helper/bats-core/load'
44
load 'test_helper/bats-assert/load'
55
load 'test_helper/util'
66

7-
87
# bats fails to handle our multiline result, so we save to $output ourselves
98
output=$( load_fixture "file-moves" | $diff_so_fancy )
109

@@ -19,3 +18,18 @@ output=$( load_fixture "file-moves" | $diff_so_fancy )
1918
@test "header_clean 'deleted:'" {
2019
assert_output --partial 'deleted: circle.yml'
2120
}
21+
22+
@test "header_clean permission changes" {
23+
output=$( load_fixture "file-perms" | $diff_so_fancy )
24+
assert_output --partial 'circle.yml changed file mode to 100755'
25+
}
26+
27+
@test "header_clean new file mode is removed" {
28+
output=$( load_fixture "file-perms" | $diff_so_fancy )
29+
refute_output --partial 'new file mode'
30+
}
31+
32+
@test "header_clean deleted file mode is removed" {
33+
output=$( load_fixture "file-perms" | $diff_so_fancy )
34+
refute_output --partial 'deleted file mode'
35+
}

0 commit comments

Comments
 (0)