@@ -7,7 +7,7 @@ use assert_fs::{
77
88use crate :: domain:: cargo_toml:: { CargoDependencyValue , DetailedCargoDependency } ;
99
10- use super :: CargoTomlFile ;
10+ use super :: File ;
1111
1212fn get_temporary_cargo_toml_path ( temp_dir : & TempDir ) -> PathBuf {
1313 let cargo_toml_content = r#"[package]
@@ -50,8 +50,7 @@ fn new_successfully_parses_valid_cargo_toml_dependencies() {
5050 let temporary_cargo_toml_path = get_temporary_cargo_toml_path ( & temp_dir) ;
5151
5252 // act
53- let CargoTomlFile { dependencies, .. } =
54- CargoTomlFile :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap ( ) ;
53+ let File { dependencies, .. } = File :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap ( ) ;
5554
5655 // assert
5756 assert_eq ! ( dependencies. len( ) , 9 ) ;
@@ -83,7 +82,7 @@ fn new_handles_missing_cargo_toml() {
8382 let temporary_cargo_toml_path = temp_dir. join ( "Cargoooo.toml" ) ;
8483
8584 // act
86- let outcome = CargoTomlFile :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap_err ( ) ;
85+ let outcome = File :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap_err ( ) ;
8786
8887 // assert
8988 assert_eq ! (
@@ -132,7 +131,7 @@ trycmd = "0.15.8"
132131 let temporary_cargo_toml_path = temp_dir. join ( "Cargo.toml" ) ;
133132
134133 // act
135- let outcome = CargoTomlFile :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap_err ( ) ;
134+ let outcome = File :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap_err ( ) ;
136135
137136 // assert
138137 assert_eq ! (
@@ -157,7 +156,7 @@ trycmd = "0.15.8"
157156fn print_changes_versus_previous_version_advises_when_there_are_no_changes ( ) {
158157 let temp_dir = assert_fs:: TempDir :: new ( ) . unwrap ( ) ;
159158 let temporary_cargo_toml_path = get_temporary_cargo_toml_path ( & temp_dir) ;
160- let cargo_toml_file = CargoTomlFile :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap ( ) ;
159+ let cargo_toml_file = File :: new ( temporary_cargo_toml_path. to_str ( ) . unwrap ( ) ) . unwrap ( ) ;
161160
162161 // act
163162 let output = cargo_toml_file
@@ -230,8 +229,8 @@ assert_fs = "1.1.2"
230229trycmd = "0.15.8"
231230"# ;
232231
233- let updated_cargo_toml = CargoTomlFile :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
234- let earlier_cargo_toml = CargoTomlFile :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
232+ let updated_cargo_toml = File :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
233+ let earlier_cargo_toml = File :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
235234 // act
236235 let output = updated_cargo_toml
237236 . print_changes_versus_previous_version ( & earlier_cargo_toml)
@@ -310,8 +309,8 @@ assert_fs = "1.1.2"
310309trycmd = "0.15.8"
311310"# ;
312311
313- let updated_cargo_toml = CargoTomlFile :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
314- let earlier_cargo_toml = CargoTomlFile :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
312+ let updated_cargo_toml = File :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
313+ let earlier_cargo_toml = File :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
315314
316315 // act
317316 let output = updated_cargo_toml
@@ -389,8 +388,8 @@ assert_fs = "1.1.2"
389388trycmd = "0.15.8"
390389"# ;
391390
392- let updated_cargo_toml = CargoTomlFile :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
393- let earlier_cargo_toml = CargoTomlFile :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
391+ let updated_cargo_toml = File :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
392+ let earlier_cargo_toml = File :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
394393
395394 // act
396395 let output = updated_cargo_toml
@@ -475,8 +474,8 @@ trycmd = "0.15.8"
475474wiremock = "0.6.2"
476475"# ;
477476
478- let updated_cargo_toml = CargoTomlFile :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
479- let earlier_cargo_toml = CargoTomlFile :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
477+ let updated_cargo_toml = File :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
478+ let earlier_cargo_toml = File :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
480479
481480 // act
482481 let output = updated_cargo_toml
@@ -562,8 +561,8 @@ fs_extra = "1.3.0"
562561glob = "0.3.1"
563562"# ;
564563
565- let updated_cargo_toml = CargoTomlFile :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
566- let earlier_cargo_toml = CargoTomlFile :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
564+ let updated_cargo_toml = File :: new_from_str ( updated_cargo_toml_content) . unwrap ( ) ;
565+ let earlier_cargo_toml = File :: new_from_str ( earlier_cargo_toml_content) . unwrap ( ) ;
567566
568567 // act
569568 let output = updated_cargo_toml
@@ -624,7 +623,7 @@ fn new_from_buffer_creates_expected_config() {
624623 ] ;
625624
626625 // act
627- let outcome = CargoTomlFile :: new_from_buffer ( & buffer) . unwrap ( ) ;
626+ let outcome = File :: new_from_buffer ( & buffer) . unwrap ( ) ;
628627
629628 // assert
630629 insta:: assert_snapshot!( format!( "{outcome:?}" ) ) ;
0 commit comments