Skip to content

Commit

Permalink
test(handle): add test using '-' special operator
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBrandao1618 authored and EduardoRodriguesF committed May 14, 2024
1 parent ac35e64 commit c8bed82
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/it/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,3 +300,25 @@ fn url_inheritance_multilevel() -> TestResult {

Ok(())
}
#[test]
fn use_previous_handle() -> TestResult {
let quartz = Quartz::preset_empty_project()?;
quartz.cmd(&["create", "endpoint1", "--url", "https://httpbin.org"])?;
quartz.cmd(&["create", "endpoint2", "--url", "https://httpbin.org/get"])?;
quartz.cmd(&["use", "endpoint1"])?;
let output = quartz.cmd(&["show", "handle"])?.stdout;
assert_eq!(output.trim(), "endpoint1");

quartz.cmd(&["use", "endpoint2"])?;
let output = quartz.cmd(&["show", "handle"])?.stdout;
assert_eq!(output.trim(), "endpoint2");

quartz.cmd(&["use", "-"])?;
let output = quartz.cmd(&["show", "handle"])?.stdout;
assert_eq!(output.trim(), "endpoint1");

quartz.cmd(&["use", "-"])?;
let output = quartz.cmd(&["show", "handle"])?.stdout;
assert_eq!(output.trim(), "endpoint2");
Ok(())
}

0 comments on commit c8bed82

Please sign in to comment.