@@ -7,24 +7,35 @@ final class IgnoreFileTests: XCTestCase {
7
7
let url = Bundle . module. url ( forResource: " missing " , withExtension: " " , subdirectory: " Ignore Files " )
8
8
XCTAssertNotNil ( url)
9
9
XCTAssertNil ( try IgnoreFile ( forDirectory: url!) )
10
+ XCTAssertNil ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
10
11
}
11
12
12
13
func testValidIgnoreFile( ) throws {
13
14
let url = Bundle . module. url ( forResource: " valid " , withExtension: " " , subdirectory: " Ignore Files " )
14
15
XCTAssertNotNil ( url)
15
16
XCTAssertNotNil ( try IgnoreFile ( forDirectory: url!) )
17
+ XCTAssertNotNil ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
16
18
}
17
19
18
20
func testInvalidIgnoreFile( ) throws {
19
21
let url = Bundle . module. url ( forResource: " invalid " , withExtension: " " , subdirectory: " Ignore Files " )
20
22
XCTAssertNotNil ( url)
21
23
XCTAssertThrowsError ( try IgnoreFile ( forDirectory: url!) )
24
+ XCTAssertThrowsError ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
22
25
}
23
26
24
27
func testEmptyIgnoreFile( ) throws {
25
28
let url = Bundle . module. url ( forResource: " empty " , withExtension: " " , subdirectory: " Ignore Files " )
26
29
XCTAssertNotNil ( url)
27
30
XCTAssertThrowsError ( try IgnoreFile ( forDirectory: url!) )
31
+ XCTAssertThrowsError ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
32
+ }
33
+
34
+ func testNestedIgnoreFile( ) throws {
35
+ let url = Bundle . module. url ( forResource: " nested " , withExtension: " " , subdirectory: " Ignore Files " )
36
+ XCTAssertNotNil ( url)
37
+ let subdirectory = url!. appendingPathComponent ( " subdirectory " ) . appending ( path: " file.swift " )
38
+ XCTAssertNotNil ( try IgnoreFile ( for: subdirectory) )
28
39
}
29
40
30
41
}
0 commit comments