summaryrefslogtreecommitdiffstats
path: root/tests/languages/ruby_test.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-10 14:27:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-10 14:27:51 +0000
commit629f6511c5a49f56689ba18053d8cf8ff91a8829 (patch)
tree4393e565bfa4ba3117ac3ed74fabacd54e3366db /tests/languages/ruby_test.py
parentAdding upstream version 2.11.1. (diff)
downloadpre-commit-629f6511c5a49f56689ba18053d8cf8ff91a8829.tar.xz
pre-commit-629f6511c5a49f56689ba18053d8cf8ff91a8829.zip
Adding upstream version 2.12.0.upstream/2.12.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/languages/ruby_test.py')
-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'