@@ -14,13 +14,7 @@ async fn test_write() -> anyhow::Result<()> {
14 let mut file = tempfile::NamedTempFile::new()?;
14 let mut file = tempfile::NamedTempFile::new()?;
16 test_key_sequence(
16 test_key_sequence(
17− &mut Application::new(
17+ &mut helpers::app_with_file(file.path())?,
19− files: vec![(file.path().to_path_buf(), Position::default())],
24 Some("ii can eat glass, it will not hurt me<ret><esc>:w<ret>"),
18 Some("ii can eat glass, it will not hurt me<ret><esc>:w<ret>"),
@@ -46,13 +40,7 @@ async fn test_write_quit() -> anyhow::Result<()> {
46 let mut file = tempfile::NamedTempFile::new()?;
40 let mut file = tempfile::NamedTempFile::new()?;
48 test_key_sequence(
42 test_key_sequence(
49− &mut Application::new(
43+ &mut helpers::app_with_file(file.path())?,
51− files: vec![(file.path().to_path_buf(), Position::default())],
56 Some("ii can eat glass, it will not hurt me<ret><esc>:wq<ret>"),
44 Some("ii can eat glass, it will not hurt me<ret><esc>:wq<ret>"),
@@ -86,13 +74,7 @@ async fn test_write_concurrent() -> anyhow::Result<()> {
88 test_key_sequence(
76 test_key_sequence(
89− &mut Application::new(
77+ &mut helpers::app_with_file(file.path())?,
91− files: vec![(file.path().to_path_buf(), Position::default())],
96 Some(&command),
78 Some(&command),
@@ -115,13 +97,7 @@ async fn test_write_fail_mod_flag() -> anyhow::Result<()> {
115 let file = helpers::new_readonly_tempfile()?;
97 let file = helpers::new_readonly_tempfile()?;
117 test_key_sequences(
99 test_key_sequences(
118− &mut Application::new(
100+ &mut helpers::app_with_file(file.path())?,
120− files: vec![(file.path().to_path_buf(), Position::default())],
121− ..Default::default()