@@ -7,24 +7,35 @@ final class IgnoreFileTests: XCTestCase {
77 let url = Bundle . module. url ( forResource: " missing " , withExtension: " " , subdirectory: " Ignore Files " )
88 XCTAssertNotNil ( url)
99 XCTAssertNil ( try IgnoreFile ( forDirectory: url!) )
10+ XCTAssertNil ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
1011 }
1112
1213 func testValidIgnoreFile( ) throws {
1314 let url = Bundle . module. url ( forResource: " valid " , withExtension: " " , subdirectory: " Ignore Files " )
1415 XCTAssertNotNil ( url)
1516 XCTAssertNotNil ( try IgnoreFile ( forDirectory: url!) )
17+ XCTAssertNotNil ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
1618 }
1719
1820 func testInvalidIgnoreFile( ) throws {
1921 let url = Bundle . module. url ( forResource: " invalid " , withExtension: " " , subdirectory: " Ignore Files " )
2022 XCTAssertNotNil ( url)
2123 XCTAssertThrowsError ( try IgnoreFile ( forDirectory: url!) )
24+ XCTAssertThrowsError ( try IgnoreFile ( for: url!. appending ( path: " file.swift " ) ) )
2225 }
2326
2427 func testEmptyIgnoreFile( ) throws {
2528 let url = Bundle . module. url ( forResource: " empty " , withExtension: " " , subdirectory: " Ignore Files " )
2629 XCTAssertNotNil ( url)
2730 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) )
2839 }
2940
3041}
0 commit comments