Skip to content

Commit

Permalink
Remove alternative dep from upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
tofay committed Sep 26, 2019
1 parent 12b9222 commit 204b23f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions src/bin/upgrade/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ use cargo_edit::{
use failure::Fail;
use itertools::Itertools;
use std::collections::HashMap;
use std::env;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process;
Expand Down Expand Up @@ -157,7 +156,7 @@ impl Manifests {
}
}

// Map the names of user-specified dependencies to the (optionally) requested version.
// Map the names of user-specified dependencies to the (optionally) requested version.
let selected_dependencies = only_update
.into_iter()
.map(|name| {
Expand Down Expand Up @@ -229,7 +228,7 @@ impl Manifests {
}
}

/// The set of dependencies to be upgraded, alongside the registries returned from cargo metadata, and
/// The set of dependencies to be upgraded, alongside the registries returned from cargo metadata, and
/// the desired versions, if specified by the user.
struct DesiredUpgrades(HashMap<String, (Option<String>, Option<String>)>);

Expand Down Expand Up @@ -297,8 +296,8 @@ fn process(args: Args) -> Result<()> {
let existing_dependencies = manifests.get_dependencies(dependency)?;

// Update indices for any alternative registries, unless
// we're offline or testing.
if !args.offline || env::var("CARGO_IS_TEST").is_ok() {
// we're offline.
if !args.offline {
for registry_url in existing_dependencies
.0
.values()
Expand Down
2 changes: 1 addition & 1 deletion src/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct CrateVersion {
///
/// The registry argument must be specified for crates
/// from alternative registries.
///
///
/// The latest version will be returned as a `Dependency`. This will fail, when
///
/// - there is no Internet connection and offline is false.
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/upgrade/Cargo.toml.source
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version = "0.7"

[dev-dependencies]
assert_cli = "0.2.0"
tempdir = { version = "0.3", registry = "alternative" }
tempdir = "0.3"

[build-dependencies]
serde = { version = "1.0", git= "https://github.com/serde-rs/serde.git" }
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/upgrade/Cargo.toml.target
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ version = "semver--CURRENT_VERSION_TEST"

[dev-dependencies]
assert_cli = "assert_cli--CURRENT_VERSION_TEST"
tempdir = { version = "tempdir--CURRENT_VERSION_TEST", registry = "alternative" }
tempdir = "tempdir--CURRENT_VERSION_TEST"

[build-dependencies]
serde = { version = "1.0", git= "https://github.com/serde-rs/serde.git" }
Expand Down

0 comments on commit 204b23f

Please sign in to comment.