From a317072e4e40d00632f2a66c9b2b408fc379e31e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20N=2E=20Robalino?= Date: Tue, 22 Oct 2019 08:08:24 -0500 Subject: [PATCH] Cover failure not found files cases. --- tests/command_enter_test.rs | 13 +++++++++++++ tests/command_open_tests.rs | 1 + 2 files changed, 14 insertions(+) diff --git a/tests/command_enter_test.rs b/tests/command_enter_test.rs index fe22b56db..fc4a437a2 100644 --- a/tests/command_enter_test.rs +++ b/tests/command_enter_test.rs @@ -73,3 +73,16 @@ fn knows_the_filesystems_entered() { )); }) } + +#[test] +fn errors_if_file_not_found() { + Playground::setup("enter_test_2", |dirs, _| { + let actual = nu_error!( + cwd: dirs.test(), + "enter i_dont_exist.csv" + ); + + assert!(actual.contains("File could not be opened")); + assert!(actual.contains("file not found")); + }) +} diff --git a/tests/command_open_tests.rs b/tests/command_open_tests.rs index 53e393eef..48f438f3d 100644 --- a/tests/command_open_tests.rs +++ b/tests/command_open_tests.rs @@ -226,4 +226,5 @@ fn errors_if_file_not_found() { ); assert!(actual.contains("File could not be opened")); + assert!(actual.contains("file not found")); }