summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2022-10-22 10:50:41 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2022-10-22 10:50:41 +0100
commit7f52ffc37e1a366f78ba3709f15b09ca22ca98c9 (patch)
treebd5320a7d5493a294fea27972111d54a3a024de8 /tests
parent5ce95579e42171913b0fabbb51b2beca66854ae4 (diff)
downloadsubplot-7f52ffc37e1a366f78ba3709f15b09ca22ca98c9.tar.gz
(steplibrary): Update files and runcmd to use new path type
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/subplots/common/runcmd_test.rs5
-rw-r--r--tests/subplots/common/runcmd_test.yaml7
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/subplots/common/runcmd_test.rs b/tests/subplots/common/runcmd_test.rs
index 7759e5f..d3a7ca5 100644
--- a/tests/subplots/common/runcmd_test.rs
+++ b/tests/subplots/common/runcmd_test.rs
@@ -1,3 +1,4 @@
+use std::path::Path;
use subplotlib::steplibrary::files::{self, Datadir};
use subplotlib::steplibrary::runcmd::Runcmd;
@@ -8,7 +9,7 @@ use std::os::unix::fs::PermissionsExt;
#[context(Datadir)]
fn create_script_from_embedded(
context: &ScenarioContext,
- filename: &str,
+ filename: &Path,
embedded: SubplotDataFile,
) {
files::create_from_embedded_with_other_name::call(context, filename, embedded)?;
@@ -20,6 +21,6 @@ fn create_script_from_embedded(
}
#[step]
-fn prepend_to_path(context: &mut Runcmd, dirname: &str) {
+fn prepend_to_path(context: &mut Runcmd, dirname: &Path) {
context.prepend_to_path(dirname);
}
diff --git a/tests/subplots/common/runcmd_test.yaml b/tests/subplots/common/runcmd_test.yaml
index daab202..e53c2d7 100644
--- a/tests/subplots/common/runcmd_test.yaml
+++ b/tests/subplots/common/runcmd_test.yaml
@@ -1,9 +1,12 @@
-- given: "executable script {filename} from {embedded:file}"
+- given: "executable script {filename} from {embedded}"
impl:
python:
function: create_script_from_embedded
rust:
function: create_script_from_embedded
+ types:
+ filename: path
+ embedded: file
- when: "I prepend {dirname} to PATH"
impl:
@@ -11,3 +14,5 @@
function: runcmd_prepend_to_path
rust:
function: prepend_to_path
+ types:
+ dirname: path