1- use assert_cmd:: cargo:: cargo_bin;
21use assert_cmd:: Command ;
32use predicates:: prelude:: * ;
43use std:: { error:: Error , fs} ;
@@ -12,7 +11,7 @@ pub fn stripped_output(output: Vec<u8>) -> String {
1211#[ test]
1312fn test_check_with_privacy_dependency_error_template_overrides (
1413) -> Result < ( ) , Box < dyn Error > > {
15- let output = Command :: new ( cargo_bin ! ( "pks" ) )
14+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
1615 . arg ( "--project-root" )
1716 . arg ( "tests/fixtures/privacy_violation_overrides" )
1817 . arg ( "--debug" )
@@ -34,7 +33,7 @@ fn test_check_with_privacy_dependency_error_template_overrides(
3433}
3534#[ test]
3635fn test_check ( ) -> Result < ( ) , Box < dyn Error > > {
37- let output = Command :: new ( cargo_bin ! ( "pks" ) )
36+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
3837 . arg ( "--project-root" )
3938 . arg ( "tests/fixtures/simple_app" )
4039 . arg ( "--debug" )
@@ -57,7 +56,7 @@ fn test_check() -> Result<(), Box<dyn Error>> {
5756
5857#[ test]
5958fn test_check_enforce_privacy_disabled ( ) -> Result < ( ) , Box < dyn Error > > {
60- let output = Command :: new ( cargo_bin ! ( "pks" ) )
59+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
6160 . arg ( "--project-root" )
6261 . arg ( "tests/fixtures/simple_app" )
6362 . arg ( "--debug" )
@@ -80,7 +79,7 @@ fn test_check_enforce_privacy_disabled() -> Result<(), Box<dyn Error>> {
8079
8180#[ test]
8281fn test_check_enforce_dependency_disabled ( ) -> Result < ( ) , Box < dyn Error > > {
83- let output = Command :: new ( cargo_bin ! ( "pks" ) )
82+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
8483 . arg ( "--project-root" )
8584 . arg ( "tests/fixtures/simple_app" )
8685 . arg ( "--debug" )
@@ -103,7 +102,7 @@ fn test_check_enforce_dependency_disabled() -> Result<(), Box<dyn Error>> {
103102
104103#[ test]
105104fn test_check_with_single_file ( ) -> Result < ( ) , Box < dyn Error > > {
106- let output = Command :: new ( cargo_bin ! ( "pks" ) )
105+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
107106 . arg ( "--project-root" )
108107 . arg ( "tests/fixtures/simple_app" )
109108 . arg ( "--debug" )
@@ -128,7 +127,7 @@ fn test_check_with_single_file() -> Result<(), Box<dyn Error>> {
128127#[ test]
129128fn test_check_with_single_file_experimental_parser (
130129) -> Result < ( ) , Box < dyn Error > > {
131- let output = Command :: new ( cargo_bin ! ( "pks" ) )
130+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
132131 . arg ( "--project-root" )
133132 . arg ( "tests/fixtures/simple_app" )
134133 . arg ( "--debug" )
@@ -153,7 +152,7 @@ fn test_check_with_single_file_experimental_parser(
153152
154153#[ test]
155154fn test_check_with_package_todo_file ( ) -> Result < ( ) , Box < dyn Error > > {
156- Command :: new ( cargo_bin ! ( "pks" ) )
155+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
157156 . arg ( "--project-root" )
158157 . arg ( "tests/fixtures/contains_package_todo" )
159158 . arg ( "--debug" )
@@ -169,7 +168,7 @@ fn test_check_with_package_todo_file() -> Result<(), Box<dyn Error>> {
169168
170169#[ test]
171170fn test_check_with_package_todo_file_csv ( ) -> Result < ( ) , Box < dyn Error > > {
172- Command :: new ( cargo_bin ! ( "pks" ) )
171+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
173172 . arg ( "--project-root" )
174173 . arg ( "tests/fixtures/contains_package_todo" )
175174 . arg ( "--debug" )
@@ -189,7 +188,7 @@ fn test_check_with_package_todo_file_csv() -> Result<(), Box<dyn Error>> {
189188#[ test]
190189fn test_check_with_package_todo_file_ignoring_recorded_violations (
191190) -> Result < ( ) , Box < dyn Error > > {
192- let output = Command :: new ( cargo_bin ! ( "pks" ) )
191+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
193192 . arg ( "--project-root" )
194193 . arg ( "tests/fixtures/contains_package_todo" )
195194 . arg ( "--debug" )
@@ -213,7 +212,7 @@ fn test_check_with_package_todo_file_ignoring_recorded_violations(
213212
214213#[ test]
215214fn test_check_with_experimental_parser ( ) -> Result < ( ) , Box < dyn Error > > {
216- let output = Command :: new ( cargo_bin ! ( "pks" ) )
215+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
217216 . arg ( "--project-root" )
218217 . arg ( "tests/fixtures/simple_app" )
219218 . arg ( "--experimental-parser" )
@@ -237,7 +236,7 @@ fn test_check_with_experimental_parser() -> Result<(), Box<dyn Error>> {
237236
238237#[ test]
239238fn test_check_with_stale_violations ( ) -> Result < ( ) , Box < dyn Error > > {
240- Command :: new ( cargo_bin ! ( "pks" ) )
239+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
241240 . arg ( "--project-root" )
242241 . arg ( "tests/fixtures/contains_stale_violations" )
243242 . arg ( "check" )
@@ -254,7 +253,7 @@ fn test_check_with_stale_violations() -> Result<(), Box<dyn Error>> {
254253#[ test]
255254fn test_check_with_stale_violations_when_file_no_longer_exists (
256255) -> Result < ( ) , Box < dyn Error > > {
257- Command :: new ( cargo_bin ! ( "pks" ) )
256+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
258257 . arg ( "--project-root" )
259258 . arg ( "tests/fixtures/contains_stale_violations_no_file" )
260259 . arg ( "check" )
@@ -270,7 +269,7 @@ fn test_check_with_stale_violations_when_file_no_longer_exists(
270269
271270#[ test]
272271fn test_check_with_relationship_violations ( ) -> Result < ( ) , Box < dyn Error > > {
273- Command :: new ( cargo_bin ! ( "pks" ) )
272+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
274273 . arg ( "--project-root" )
275274 . arg ( "tests/fixtures/app_with_rails_relationships" )
276275 . arg ( "check" )
@@ -286,7 +285,7 @@ fn test_check_with_relationship_violations() -> Result<(), Box<dyn Error>> {
286285
287286#[ test]
288287fn test_check_without_stale_violations ( ) -> Result < ( ) , Box < dyn Error > > {
289- Command :: new ( cargo_bin ! ( "pks" ) )
288+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
290289 . arg ( "--project-root" )
291290 . arg ( "tests/fixtures/contains_package_todo" )
292291 . arg ( "check" )
@@ -305,7 +304,7 @@ fn test_check_without_stale_violations() -> Result<(), Box<dyn Error>> {
305304
306305#[ test]
307306fn test_check_with_strict_mode ( ) -> Result < ( ) , Box < dyn Error > > {
308- Command :: new ( cargo_bin ! ( "pks" ) )
307+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
309308 . arg ( "--project-root" )
310309 . arg ( "tests/fixtures/uses_strict_mode" )
311310 . arg ( "check" )
@@ -324,7 +323,7 @@ fn test_check_with_strict_mode() -> Result<(), Box<dyn Error>> {
324323
325324#[ test]
326325fn test_check_with_strict_mode_output_csv ( ) -> Result < ( ) , Box < dyn Error > > {
327- Command :: new ( cargo_bin ! ( "pks" ) )
326+ Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
328327 . arg ( "--project-root" )
329328 . arg ( "tests/fixtures/uses_strict_mode" )
330329 . arg ( "check" )
@@ -348,7 +347,7 @@ fn test_check_contents() -> Result<(), Box<dyn Error>> {
348347 let foo_rb_contents =
349348 fs:: read_to_string ( format ! ( "{}/{}" , project_root, relative_path) ) ?;
350349
351- let output = Command :: new ( cargo_bin ! ( "pks" ) )
350+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
352351 . arg ( "--project-root" )
353352 . arg ( project_root)
354353 . arg ( "--debug" )
@@ -379,7 +378,7 @@ fn test_check_contents_ignoring_recorded_violations(
379378 let foo_rb_contents =
380379 fs:: read_to_string ( format ! ( "{}/{}" , project_root, relative_path) ) ?;
381380
382- let output = Command :: new ( cargo_bin ! ( "pks" ) )
381+ let output = Command :: new ( assert_cmd :: cargo :: cargo_bin!( "pks" ) )
383382 . arg ( "--project-root" )
384383 . arg ( project_root)
385384 . arg ( "--debug" )
0 commit comments