Skip to content

Commit

Permalink
chore: Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Jan 1, 2024
1 parent 1e51847 commit 834d089
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
21 changes: 9 additions & 12 deletions tests/binary_test.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
mod install {
use cargo_run_bin::{binary::install, metadata};
use cargo_run_bin::binary::install;
use cargo_run_bin::metadata;
use cfg_if::cfg_if;

#[test]
fn it_returns_bin_path() {
let binary_packages = metadata::get_binary_packages().unwrap();
let nextest = binary_packages
.iter()
.find(|&e| {
return e.package == "cargo-nextest";
})
.find(|&e| e.package == "cargo-nextest")
.unwrap();

let cache_bin_path = install(nextest.clone()).unwrap();
Expand Down Expand Up @@ -162,7 +161,8 @@ mod cargo_install {
}

mod binstall {
use cargo_run_bin::{binary::binstall, metadata};
use cargo_run_bin::binary::binstall;
use cargo_run_bin::metadata;

#[test]
fn it_builds_successfully() {
Expand Down Expand Up @@ -210,19 +210,16 @@ mod binstall {
}

mod run {
use cargo_run_bin::{
binary::{install, run},
metadata,
};
use cargo_run_bin::binary::install;
use cargo_run_bin::binary::run;
use cargo_run_bin::metadata;

#[test]
fn it_runs_help_successfully() {
let binary_packages = metadata::get_binary_packages().unwrap();
let nextest = binary_packages
.iter()
.find(|&e| {
return e.package == "cargo-nextest";
})
.find(|&e| e.package == "cargo-nextest")
.unwrap();
let cache_bin_path = install(nextest.clone()).unwrap();

Expand Down
8 changes: 5 additions & 3 deletions tests/cli_integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ use cargo_run_bin::metadata;
fn get_bin() -> String {
return metadata::get_project_root()
.unwrap()
.join(env!("CARGO_BIN_EXE_cargo-bin"))
.join(env!("CARGO_BIN_EXE_cargo-bin").replace(".exe", ""))
.to_str()
.unwrap()
.to_string();
}

mod direct {
use super::get_bin;
use assert_cmd::Command;

use super::get_bin;

#[test]
fn it_syncs_aliases_successfully() {
let mut cmd = Command::cargo_bin(get_bin()).unwrap();
Expand Down Expand Up @@ -83,9 +84,10 @@ mod direct {
}

mod bin_prefix {
use super::get_bin;
use assert_cmd::Command;

use super::get_bin;

#[test]
fn it_syncs_aliases_successfully() {
let mut cmd = Command::cargo_bin(get_bin()).unwrap();
Expand Down
8 changes: 4 additions & 4 deletions tests/metadata_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ mod get_binary_packages {
#[test]
fn it_returns_locked_packages() {
let binary_packages = get_binary_packages().unwrap();
let nextest = binary_packages.iter().find(|&e| {
return e.package == "cargo-nextest";
});
let nextest = binary_packages
.iter()
.find(|&e| e.package == "cargo-nextest");

assert!(nextest.is_some());
let res = nextest.unwrap();
Expand All @@ -19,7 +19,7 @@ mod get_binary_packages {
fn it_returns_bin_target_packages() {
let binary_packages = get_binary_packages().unwrap();
let android = binary_packages.iter().find(|&e| {
return e.bin_target.is_some() && e.bin_target.clone().unwrap() == "hello-world-first";
e.bin_target.is_some() && e.bin_target.clone().unwrap() == "hello-world-first"
});

assert!(android.is_some());
Expand Down
3 changes: 2 additions & 1 deletion tests/shims_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod sync_shims {
use cargo_run_bin::{metadata, shims::sync};
use cargo_run_bin::metadata;
use cargo_run_bin::shims::sync;

#[test]
#[cfg(target_family = "unix")]
Expand Down

0 comments on commit 834d089

Please sign in to comment.