Skip to content

Commit bcd3832

Browse files
committed
FileConventions.Test: add failing test
Add failing test for DetectNotUsingKebabCaseInGitHubCIJobs function.
1 parent 5978221 commit bcd3832

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
FileConventions:
7+
runs-on: ubuntu-22.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Print "Hello World!"
11+
run: echo "Hello World!"

src/FileConventions.Test/FileConventions.Test.fs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,16 @@ let DetectNotUsingSnakeCaseInScriptName3() =
299299
(FileInfo(Path.Combine(dummyFilesDirectory.FullName, "kebab-case.fsx")))
300300

301301
Assert.That(DetectNotUsingSnakeCaseInScriptName fileInfo, Is.EqualTo true)
302+
303+
304+
[<Test>]
305+
let DetectNotUsingKebabCaseInGitHubCIJobs1() =
306+
let fileInfo =
307+
(FileInfo(
308+
Path.Combine(
309+
dummyFilesDirectory.FullName,
310+
"DummyCIWithPascalCaseJobName.yml"
311+
)
312+
))
313+
314+
Assert.That(DetectNotUsingKebabCaseInGitHubCIJobs fileInfo, Is.EqualTo true)

src/FileConventions/Library.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ let DetectNotUsingSnakeCaseInScriptName(fileInfo: FileInfo) =
127127
let fileName = fileInfo.Name
128128
let snakeCase = fileName.ToLower() = fileName && not(fileName.Contains "-")
129129
not(snakeCase)
130+
131+
let DetectNotUsingKebabCaseInGitHubCIJobs(fileInfo: FileInfo) =
132+
assert (fileInfo.FullName.EndsWith ".yml")
133+
false

0 commit comments

Comments
 (0)