summaryrefslogtreecommitdiffstats
path: root/tests/languages
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-10 14:27:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-19 13:32:50 +0000
commit35f0c72f09eaa652cb468ed1b4ad7c707ed83c5e (patch)
treec0257364c514cb1c845d82e34a6e5dd9b1fc28c3 /tests/languages
parentReleasing debian version 2.11.1-1. (diff)
downloadpre-commit-35f0c72f09eaa652cb468ed1b4ad7c707ed83c5e.tar.xz
pre-commit-35f0c72f09eaa652cb468ed1b4ad7c707ed83c5e.zip
Merging upstream version 2.12.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/languages')
-rw-r--r--tests/languages/ruby_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/languages/ruby_test.py b/tests/languages/ruby_test.py
index 6c0c9e5..0c6cfed 100644
--- a/tests/languages/ruby_test.py
+++ b/tests/languages/ruby_test.py
@@ -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'