1
0
Fork 0

Adding upstream version 2.12.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-09 21:26:31 +01:00
parent 3faf89852c
commit 851c52101f
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 58 additions and 71 deletions

View file

@ -1,4 +1,5 @@
import os.path
import tarfile
from unittest import mock
import pytest
@ -8,6 +9,7 @@ from pre_commit import parse_shebang
from pre_commit.languages import ruby
from pre_commit.prefix import Prefix
from pre_commit.util import cmd_output
from pre_commit.util import resource_bytesio
from testing.util import xfailif_windows
@ -72,3 +74,14 @@ def test_install_ruby_with_version(fake_gem_prefix):
# Should be able to activate and use rbenv install
with ruby.in_env(fake_gem_prefix, '2.7.2'):
cmd_output('rbenv', 'install', '--help')
@pytest.mark.parametrize(
'filename',
('rbenv.tar.gz', 'ruby-build.tar.gz', 'ruby-download.tar.gz'),
)
def test_archive_root_stat(filename):
with resource_bytesio(filename) as f:
with tarfile.open(fileobj=f) as tarf:
root, _, _ = filename.partition('.')
assert oct(tarf.getmember(root).mode) == '0o755'