Skip to content

Commit

Permalink
Merge pull request #71 from minakawa-daiki/add-integration-template
Browse files Browse the repository at this point in the history
Added Integration test template
  • Loading branch information
utam0k authored Jun 7, 2021
2 parents 2cc1433 + 297d786 commit f9479f8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Integration test

## Usage
Here is a preview implementation of the integration test.

```
$ cargo test --test integration
```
19 changes: 19 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
use std::env;
use std::path::PathBuf;
use std::process::{Command, Stdio};

#[test]
fn main() {
let current_dir_path_result = env::current_dir();
let current_dir_path = match current_dir_path_result {
Ok(path_buf) => path_buf,
Err(_) => panic!("directory is not found"),
};
let youki_path = current_dir_path.join(PathBuf::from("youki"));
let status = Command::new(youki_path)
.stdout(Stdio::null())
.arg("-h")
.status()
.expect("failed to execute process");
assert!(status.success());
}

0 comments on commit f9479f8

Please sign in to comment.