Executes the test and expects the given error kind.
(mut self, exp_kind: io::ErrorKind)
| 640 | |
| 641 | /// Executes the test and expects the given error kind. |
| 642 | fn expect_err(mut self, exp_kind: io::ErrorKind) { |
| 643 | let mut console = MockConsole::default(); |
| 644 | console.add_input_keys(&self.keys); |
| 645 | console.set_size_chars(self.size_chars); |
| 646 | let err = block_on(read_line_interactive( |
| 647 | &mut console, |
| 648 | self.prompt, |
| 649 | self.previous, |
| 650 | self.history.as_mut(), |
| 651 | self.echo, |
| 652 | )) |
| 653 | .expect_err("read_line_interactive should fail"); |
| 654 | assert_eq!(exp_kind, err.kind()); |
| 655 | assert_eq!(self.exp_output.as_slice(), console.captured_out()); |
| 656 | assert_eq!(self.exp_history, self.history); |
| 657 | } |
| 658 | } |
| 659 | |
| 660 | #[test] |