Skip to content

Commit

Permalink
remove filename constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
skarimo committed Feb 9, 2024
1 parent eecaa4e commit 79176b9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/scenarios/fixtures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,18 @@ pub async fn before_scenario(
) {
collect_function_calls(world);

let escaped_filename = NON_ALNUM_RE
let filename = NON_ALNUM_RE
.replace_all(scenario.name.as_str(), "-")
.to_string();
let filename = match escaped_filename.len() > 100 {
true => escaped_filename[..100].to_string(),
false => escaped_filename,
};
let mut prefix = "Test".to_string();
let mut cassette_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
cassette_dir.push(format!(
"tests/scenarios/cassettes/v{}/{}",
world.api_version,
feature.name.replace(' ', "_").to_lowercase()
));
log::debug!("Check the freeezee --- {}", feature.name);

create_dir_all(&cassette_dir).expect("failed to create cassette directory");
let mut cassette = cassette_dir.clone();
cassette.push(format!("{}.json", filename));
Expand Down

0 comments on commit 79176b9

Please sign in to comment.