$(TOML): $(wildcard libs/rust-toml/src/toml/*.rs)
cd libs/rust-toml && make
-$(HAMCREST): $(wildcard libs/hamcrest-rust/src/*.rs)
+$(HAMCREST): $(wildcard libs/hamcrest-rust/src/hamcrest/*.rs)
cd libs/hamcrest-rust && make
# === Cargo
use std;
use support::project;
+use hamcrest::{SelfDescribing,Description,Matcher,assert_that};
use cargo;
+#[deriving(Clone,Eq)]
+pub struct ExistingFile;
+
+impl SelfDescribing for ExistingFile {
+ fn describe_to(&self, desc: &mut Description) {
+ desc.append_text("an existing file");
+ }
+}
+
+impl Matcher<Path> for ExistingFile {
+ fn matches(&self, actual: &Path) -> bool {
+ actual.exists()
+ }
+
+ fn describe_mismatch(&self, actual: &Path, desc: &mut Description) {
+ desc.append_text(format!("`{}` was missing", actual.display()));
+ }
+}
+
+pub fn existing_file() -> ExistingFile {
+ ExistingFile
+}
+
fn setup() {
}
Err(e) => println!("err: {}", e)
}
+ assert_that(p.root().join("target/foo/bar"), existing_file());
assert!(p.root().join("target/foo").exists(), "the executable exists");
let o = cargo::util::process("foo")