Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix running t/getopt.t from a read-only location #1

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Sep 24, 2024

If current working directory is a read-only location, running t/getopt.t fails:

$ perl t/getopt.t
1..14
ok 1
ok 2
ok 3
ok 4
ok 5
Writing to config file <getopt.tst> failed: Permission denied
 at t/getopt.t line 62.

This patch fixes it by using a temporary directory with File::Temp. File::Temp is smart enough to find a suitalbe writable location and clean up on exit. File::Temp is already used in other tests, e.g. in t/modern.t.

If current working directory is a read-only location, running
t/getopt.t fails:

    $ perl t/getopt.t
    1..14
    ok 1
    ok 2
    ok 3
    ok 4
    ok 5
    Writing to config file <getopt.tst> failed: Permission denied
     at t/getopt.t line 62.

This patch fixes it by using a temporary directory with File::Temp.
File::Temp is smart enough to find a suitalbe writable location and
clean up on exit. File::Temp is already used in other tests, e.g. in
t/modern.t.
@eserte eserte merged commit cff8e0b into eserte:master Sep 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants