summaryrefslogtreecommitdiffstats
path: root/tests/languages
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 05:33:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 05:33:21 +0000
commitc18199f8c50affbb6297fd3a68901ea581b77582 (patch)
tree7a3a50e585f2f550438fad4b8c7a26a0ea374c23 /tests/languages
parentAdding upstream version 3.7.0. (diff)
downloadpre-commit-c18199f8c50affbb6297fd3a68901ea581b77582.tar.xz
pre-commit-c18199f8c50affbb6297fd3a68901ea581b77582.zip
Adding upstream version 3.7.1.upstream/3.7.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/languages')
-rw-r--r--tests/languages/ruby_test.py4
-rw-r--r--tests/languages/rust_test.py9
2 files changed, 11 insertions, 2 deletions
diff --git a/tests/languages/ruby_test.py b/tests/languages/ruby_test.py
index 6397a43..5d767b2 100644
--- a/tests/languages/ruby_test.py
+++ b/tests/languages/ruby_test.py
@@ -91,8 +91,8 @@ def test_ruby_additional_deps(tmp_path):
tmp_path,
ruby,
'ruby -e',
- args=('require "tins"',),
- deps=('tins',),
+ args=('require "jmespath"',),
+ deps=('jmespath',),
)
assert ret == (0, b'')
diff --git a/tests/languages/rust_test.py b/tests/languages/rust_test.py
index 5c17f5b..52e3561 100644
--- a/tests/languages/rust_test.py
+++ b/tests/languages/rust_test.py
@@ -9,6 +9,7 @@ from pre_commit import parse_shebang
from pre_commit.languages import rust
from pre_commit.store import _make_local_repo
from testing.language_helpers import run_language
+from testing.util import cwd
ACTUAL_GET_DEFAULT_VERSION = rust.get_default_version.__wrapped__
@@ -29,6 +30,14 @@ def test_uses_default_when_rust_is_not_available(cmd_output_b_mck):
assert ACTUAL_GET_DEFAULT_VERSION() == C.DEFAULT
+def test_selects_system_even_if_rust_toolchain_toml(tmp_path):
+ toolchain_toml = '[toolchain]\nchannel = "wtf"\n'
+ tmp_path.joinpath('rust-toolchain.toml').write_text(toolchain_toml)
+
+ with cwd(tmp_path):
+ assert ACTUAL_GET_DEFAULT_VERSION() == 'system'
+
+
def _make_hello_world(tmp_path):
src_dir = tmp_path.joinpath('src')
src_dir.mkdir()