Skip to content

Commit

Permalink
Update utils_test.go to allow running in read-only mode. (#91)
Browse files Browse the repository at this point in the history
Restrict `os.OpenFile` to use just read flag, which allows to pass tests on the
systems like Guix with isolated read-only environment.
  • Loading branch information
Hellseher committed Jun 10, 2024
1 parent 7eaf97a commit fedc174
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestUtilFuncs(t *testing.T) {
is.True(IsConsole(os.Stdout))
is.True(IsConsole(os.Stderr))
is.False(IsConsole(&bytes.Buffer{}))
ff, err := os.OpenFile("README.md", os.O_WRONLY, 0)
ff, err := os.OpenFile("README.md", os.O_RDONLY, 0)
is.NoError(err)
is.False(IsConsole(ff))

Expand Down

0 comments on commit fedc174

Please sign in to comment.