mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Replace const BASIC_MANIFEST with basic_manifest("foo", "0.0.1")
This commit is contained in:
parent
4e53ce48d1
commit
5659b78b76
@ -7,7 +7,7 @@ use cargo::util::{process, ProcessBuilder};
|
||||
use support::{is_nightly, rustc_host, sleep_ms};
|
||||
use support::paths::{root, CargoPathExt};
|
||||
use support::ProjectBuilder;
|
||||
use support::{BASIC_MANIFEST, basic_bin_manifest, execs, main_file, project};
|
||||
use support::{basic_manifest, basic_bin_manifest, execs, main_file, project};
|
||||
use support::registry::Package;
|
||||
use support::ChannelChanger;
|
||||
use support::hamcrest::{assert_that, existing_dir, existing_file, is_not};
|
||||
@ -2414,7 +2414,7 @@ fn deletion_causes_failure() {
|
||||
.build();
|
||||
|
||||
assert_that(p.cargo("build"), execs().with_status(0));
|
||||
p.change_file("Cargo.toml", BASIC_MANIFEST);
|
||||
p.change_file("Cargo.toml", basic_manifest("foo", "0.0.1"));
|
||||
assert_that(p.cargo("build"), execs().with_status(101));
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
|
||||
use support::paths::CargoPathExt;
|
||||
use support::{BASIC_MANIFEST, execs, project};
|
||||
use support::{basic_manifest, execs, project};
|
||||
use support::ChannelChanger;
|
||||
use support::hamcrest::assert_that;
|
||||
use support::registry::Package;
|
||||
@ -151,7 +151,7 @@ failed to select a version for `bar` which could resolve this conflict",
|
||||
),
|
||||
);
|
||||
|
||||
p.change_file("Cargo.toml", BASIC_MANIFEST);
|
||||
p.change_file("Cargo.toml", basic_manifest("foo", "0.0.1"));
|
||||
|
||||
assert_that(
|
||||
p.cargo("build").arg("--features").arg("test"),
|
||||
|
@ -118,13 +118,6 @@ pub mod paths;
|
||||
pub mod publish;
|
||||
pub mod registry;
|
||||
|
||||
pub const BASIC_MANIFEST: &str = r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.1"
|
||||
authors = []
|
||||
"#;
|
||||
|
||||
/*
|
||||
*
|
||||
* ===== Builders =====
|
||||
@ -265,7 +258,7 @@ impl ProjectBuilder {
|
||||
|
||||
let manifest_path = self.root.root().join("Cargo.toml");
|
||||
if !self.no_manifest && self.files.iter().all(|fb| fb.path != manifest_path) {
|
||||
self._file(Path::new("Cargo.toml"), BASIC_MANIFEST)
|
||||
self._file(Path::new("Cargo.toml"), basic_manifest("foo", "0.0.1"))
|
||||
}
|
||||
|
||||
for file in self.files.iter() {
|
||||
@ -1231,6 +1224,18 @@ impl<T> Tap for T {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn basic_manifest(name: &str, version: &str) -> String {
|
||||
format!(
|
||||
r#"
|
||||
[package]
|
||||
name = "{}"
|
||||
version = "{}"
|
||||
authors = []
|
||||
"#,
|
||||
name, version
|
||||
)
|
||||
}
|
||||
|
||||
pub fn basic_bin_manifest(name: &str) -> String {
|
||||
format!(
|
||||
r#"
|
||||
|
Loading…
x
Reference in New Issue
Block a user