get_file_contents

Function get_file_contents 

Source
pub fn get_file_contents(path: &str) -> Result<Vec<u8>>
Expand description

Read the contents of a file into a vector of bytes. Use for fixtures you never want to change.

Prefer this over get_reader_for_file() or get_read_only_file() when you need to compare the contents of a file.

ยงExample

use common_testing::setup;

#[test]
fn test_1() {
  let contents = setup::get_file_contents("./fixtures/test.txt").unwrap();
  // some test code
}