Skip to content
This repository was archived by the owner on Dec 29, 2021. It is now read-only.

current_dir() not working with main_binary() #116

Closed
pizzamig opened this issue Jul 5, 2018 · 4 comments
Closed

current_dir() not working with main_binary() #116

pizzamig opened this issue Jul 5, 2018 · 4 comments

Comments

@pizzamig
Copy link

pizzamig commented Jul 5, 2018

I've found what I believe it's a bug (briefly spoken with @killercup ). This is the code I'd like to use and that panics at unwrap():

    assert_cli::Assert::main_binary()
        .with_args(&["-l", "left", "-r", "right"])
        .current_dir(std::path::Path::new("/tmp"))
        .succeeds()
        .unwrap();

As workaround, I'm using this (that works):

    assert_cli::Assert::main_binary()
        .with_args(&["-l", "/tmp/left", "-r", "/tmp/right"])
        .succeeds()
        .unwrap();
  • assert_cli version: 0.6.2
  • Rust version: 1.28.0 and 1.27.0
  • OS and version: FreeBSD CURRENT and Debain 8
@epage
Copy link
Collaborator

epage commented Jul 5, 2018

This is a dup of #95 which was closed in favor of assert_cmd which doesn't have this problem.

@epage
Copy link
Collaborator

epage commented Jul 5, 2018

Btw the problems is we use cargo run. assert_cmd switches to using cargo build, capture the bin name, and then runs that bin.

@killercup
Copy link
Collaborator

Ah, right, using assert_cmd directly is definitely the best option, then.

Luca, assert_cmd is part of what I described yesterday as that next stage -- where assert_cli uses the assert_fs and assert_cmd crates internally to provide a more comprehensive framework.

I'll close this issue, but feel free to ping me if you have any questions on how to use assert_cmd!

@pizzamig
Copy link
Author

pizzamig commented Jul 7, 2018

Hi. Thanks for the reply. Using assert_cmd I solved the issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants