diff --git a/Cargo.lock b/Cargo.lock index ce67a10c..de158a8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,16 +15,27 @@ dependencies = [ ] [[package]] -name = "assert_cli" -version = "0.5.4" +name = "assert_cmd" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "skeptic 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)", + "escargot 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-tree 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "assert_fs" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "globwalk 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-tree 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -106,11 +117,6 @@ name = "bitflags" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bytecount" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "byteorder" version = "1.2.4" @@ -121,18 +127,6 @@ name = "bytes" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "cargo_metadata" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cc" version = "1.0.18" @@ -167,6 +161,14 @@ dependencies = [ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cmake" version = "0.1.31" @@ -179,7 +181,8 @@ dependencies = [ name = "cobalt-bin" version = "0.12.2" dependencies = [ - "assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "assert_cmd 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "assert_fs 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -195,6 +198,7 @@ dependencies = [ "log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rss 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -203,20 +207,11 @@ dependencies = [ "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "syntect 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "unidecode 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "colored" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "lazy_static 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crossbeam" version = "0.3.2" @@ -241,11 +236,6 @@ dependencies = [ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "difference" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "difference" version = "2.0.0" @@ -281,11 +271,6 @@ dependencies = [ "termcolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "environment" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "error-chain" version = "0.10.0" @@ -296,18 +281,19 @@ dependencies = [ [[package]] name = "error-chain" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "error-chain" -version = "0.12.0" +name = "escargot" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -326,7 +312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -349,6 +335,14 @@ dependencies = [ "miniz-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "float-cmp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fnv" version = "1.0.6" @@ -408,11 +402,6 @@ dependencies = [ "walkdir 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "glob" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "globset" version = "0.4.1" @@ -425,6 +414,15 @@ dependencies = [ "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "globwalk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ignore 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.2" @@ -749,6 +747,32 @@ dependencies = [ "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "predicates" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "normalize-line-endings 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "predicates-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "predicates-tree" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "proc-macro2" version = "0.4.9" @@ -795,14 +819,21 @@ dependencies = [ [[package]] name = "rand" -version = "0.4.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rand_core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "redox_syscall" version = "0.1.40" @@ -905,20 +936,6 @@ dependencies = [ "pkg-config 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "serde" version = "1.0.70" @@ -934,7 +951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -958,21 +975,6 @@ dependencies = [ "yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "skeptic" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytecount 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", - "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "slab" version = "0.1.3" @@ -995,7 +997,7 @@ dependencies = [ [[package]] name = "syn" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1018,7 +1020,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1042,12 +1044,15 @@ dependencies = [ ] [[package]] -name = "tempdir" -version = "0.3.7" +name = "tempfile" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1108,6 +1113,11 @@ name = "traitobject" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "treeline" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "typeable" version = "0.1.2" @@ -1295,7 +1305,8 @@ dependencies = [ [metadata] "checksum aho-corasick 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c6d463cbe7ed28720b5b489e7c083eeb8f90d08be2a0d6bb9e1ffea9ce1afa" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72342c21057a3cb5f7c2d849bf7999a83795434dd36d74fa8c24680581bd1930" +"checksum assert_cmd 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51a1fdd78b6e308d08b9d001d571e2afd09447169ba3ba7528714f960c7bb55d" +"checksum assert_fs 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6a130bff0685da340df499bea35d1bf73257faa8f03d0a3a77a0b3e0546e50d9" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" @@ -1306,33 +1317,30 @@ dependencies = [ "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" -"checksum bytecount 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "882585cd7ec84e902472df34a5e01891202db3bf62614e1f0afe459c1afcf744" "checksum byteorder 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8389c509ec62b9fe8eca58c502a0acaf017737355615243496cde4994f8fa4f9" "checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27" -"checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0" "checksum cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "2119ea4867bd2b8ed3aecab467709720b2d55b1bcfe09f772fd68066eaf15275" "checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e" "checksum chrono 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e48d85528df61dc964aa43c5f6ca681a19cfa74939b2348d204bd08a981f2fb0" "checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3" -"checksum colored 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc0a60679001b62fb628c4da80e574b9645ab4646056d7c9018885efffe45533" "checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19" "checksum derive_builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c998e6ab02a828dd9735c18f154e14100e674ed08cb4e1938f0e4177543f439" "checksum derive_builder_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "735e24ee9e5fa8e16b86da5007856e97d592e11867e45d76e0c0d0a164a0b757" -"checksum difference 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3304d19798a8e067e48d8e69b2c37f0b5e9b4e462504ad9e27e9f3fce02bba8" "checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" "checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" "checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum encoding_rs 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98fd0f24d1fb71a4a6b9330c8ca04cbd4e7cc5d846b54ca74ff376bc7c9f798d" "checksum env_logger 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "7873e292d20e8778f951278972596b3df36ac72a65c5b406f6d4961070a870c1" -"checksum environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f4b14e20978669064c33b4c1e0fb4083412e40fe56cbea2eae80fd7591503ee" "checksum error-chain 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" -"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02" +"checksum escargot 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddeb6acd0f12aeba309aa295bcad6d4d88603406640bf2595c887a7a9684a4bd" "checksum failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7efb22686e4a466b1ec1a15c2898f91fa9cb340452496dca654032de20ff95b9" "checksum failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "946d0e98a50d9831f5d589038d2ca7f8f455b1c21028c0db0e84116a12696426" "checksum filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "714653f3e34871534de23771ac7b26e999651a0a228f47beb324dfdf1dd4b10f" "checksum flate2 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)" = "e6234dd4468ae5d1e2dbb06fe2b058696fdc50a339c68a393aefbf00bc81e423" +"checksum float-cmp 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "134a8fa843d80a51a5b77d36d42bc2def9edcb0262c914861d08129fd1926600" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fsevent 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "c4bbbf71584aeed076100b5665ac14e3d85eeb31fdbb45fbd41ef9a682b5ec05" "checksum fsevent-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a772d36c338d07a032d5375a36f15f9a7043bf0cb8ce7cee658e037c6032874" @@ -1341,8 +1349,8 @@ dependencies = [ "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" "checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797" "checksum ghp 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2381a505873cc9b3bc814214150a0da3193db84cdaf3c9eb2145c7a369d337f0" -"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum globset 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8e49edbcc9c7fc5beb8c0a54e7319ff8bed353a2b55e85811c6281188c2a6c84" +"checksum globwalk 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce5d04da8cf35b507b2cbec92bbf2d5085292d07cd87637994fd437fe1617bbb" "checksum httparse 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7b6288d7db100340ca12873fd4d08ad1b8f206a9457798dfb17c018a33fee540" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" "checksum hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)" = "368cb56b2740ebf4230520e2b90ebb0461e69034d85d1945febd9b3971426db2" @@ -1380,13 +1388,17 @@ dependencies = [ "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pkg-config 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "6a52e4dbc8354505ee07e484ab07127e06d87ca6fa7f0a516a2b294e5ad5ad16" "checksum plist 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c61ac2afed2856590ae79d6f358a24b85ece246d2aa134741a66d589519b7503" +"checksum predicates 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "799dc506006c16c25b28476046abfc20a95f71de59e95ebb8ee302e029a30173" +"checksum predicates-core 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85f80bc390d1c02a4cdaa63f27f05c3c426679eb65433d8dd65d392147e4e5c5" +"checksum predicates-tree 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2e86df9b81bdcb0a5141aca9d2b9c5e0c558ef6626d3ae2c12912f5c9df740bd" "checksum proc-macro2 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "cccdc7557a98fe98453030f077df7f3a042052fae465bb61d2c2c41435cfd9b6" "checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quick-xml 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b14c27e04216596a49f2b82398a24f67ed9f131a5c0e0235496ea446bdacfb12" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b71f9f575d55555aa9c06188be9d4e2bfc83ed02537948ac0d520c24d0419f1a" -"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" +"checksum rand 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "12397506224b2f93e6664ffc4f664b29be8208e5157d3d90b44f09b5fae470ea" +"checksum rand_core 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edecf0f94da5551fc9b492093e30b041a891657db7940ee221f9d2f66e82eef2" "checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5bbbea44c5490a1e84357ff28b7d518b4619a159fed5d25f6c1de2d19cc42814" @@ -1400,21 +1412,18 @@ dependencies = [ "checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637" "checksum sass-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90f8cf6e645aa843ffffcbdc1e8752b1f221dfa314c81895aeb229a77aea7e05" "checksum sass-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "bae88baa915f59c39820e544cfd9296d815a6b8efc3f276a78a0505866d2b4e9" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "0c3adf19c07af6d186d91dae8927b83b0553d07ca56cbf7f2f32560455c91920" "checksum serde_derive 1.0.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3525a779832b08693031b8ecfb0de81cd71cfd3812088fafe9a7496789572124" "checksum serde_json 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c6908c7b925cd6c590358a4034de93dbddb20c45e1d021931459fd419bf0e2" "checksum serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8099d3df28273c99a1728190c7a9f19d444c941044f64adf986bee7ec53051" -"checksum skeptic 0.13.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4474d6da9593171bcb086890fc344a3a12783cb24e5b141f8a5d0e43561f4b6" "checksum slab 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d807fd58c4181bbabed77cb3b891ba9748241a552bcc5be698faaebefc54f46e" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4bad7abdf6633f07c7046b90484f1d9dc055eca39f8c991177b1046ce61dba9a" +"checksum syn 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4e4b5274d4a0a3d2749d5c158dc64d3403e60554dc61194648787ada5212473d" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "85bb9b7550d063ea184027c9b8c20ac167cd36d3e06b3a40bceb9d746dc1a7b7" "checksum syntect 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ff5898205c88327ab1c99dfd25337e9f29e547e0596a5b098a6780a43801e3c5" -"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +"checksum tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c4b103c6d08d323b92ff42c8ce62abcd83ca8efa7fd5bf7927efefec75f58c76" "checksum termcolor 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "722426c4a0539da2c4ffd9b419d90ad540b4cff4a053be9069c908d4d07e2836" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" @@ -1422,6 +1431,7 @@ dependencies = [ "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" "checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" diff --git a/Cargo.toml b/Cargo.toml index 189a28d1..db140df6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,9 +59,10 @@ default-features = false features = ["parsing", "assets", "html", "static-onig", "dump-load"] [dev-dependencies] -assert_cli = "0.5" +assert_cmd = "0.9" +assert_fs = "0.9" +predicates = "0.9" difference = "2.0" -tempdir = "0.3" [features] default = ["syntax-highlight", "sass"] diff --git a/tests/cli.rs b/tests/cli.rs index 076e653c..7c5426f2 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -1,191 +1,197 @@ -extern crate assert_cli; -#[macro_use] -extern crate lazy_static; -extern crate tempdir; - -use std::env; -use std::path::{Path, PathBuf}; -use std::str; - -use tempdir::TempDir; - -lazy_static! { - static ref _CWD: PathBuf = env::current_dir().unwrap(); - static ref CWD: &'static Path = _CWD.as_path(); - // TODO test on release - static ref _BIN: PathBuf = CWD.join("target/debug/cobalt"); - static ref BIN: &'static str = _BIN.to_str().unwrap(); -} +extern crate assert_cmd; +extern crate assert_fs; +extern crate predicates; + +use std::process; + +use assert_cmd::prelude::*; +use assert_fs::prelude::*; +use predicates::prelude::*; #[test] pub fn invalid_calls() { - println!("Binary: {:?}", BIN.to_owned()); - assert_cli::Assert::command(&[&BIN]) - .fails() - .stderr() - .contains("requires a subcommand") - .unwrap(); - - assert_cli::Assert::command(&[&BIN, "--nonexistent-argument"]) - .fails_with(1) - .stderr() - .contains(r"Found argument '--nonexistent-argument' which wasn't expected") - .unwrap(); + process::Command::cargo_bin("cobalt") + .unwrap() + .assert() + .failure() + .stderr(predicate::str::contains("requires a subcommand").from_utf8()); + + process::Command::cargo_bin("cobalt") + .unwrap() + .arg("--nonexistent-argument") + .assert() + .failure() + .stderr(predicate::str::contains("--nonexistent-argument").from_utf8()); } #[test] pub fn log_levels_trace() { - let destdir = TempDir::new("trace").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "build", "-L", "trace", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) - .stderr() - .contains("TRACE") - .stderr() - .contains("DEBUG") - .stderr() - .contains("INFO") + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); - destdir.close().unwrap(); + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "-L", "trace"]) + .current_dir(project_root.path()) + .assert() + .success() + .stderr(predicate::str::contains("TRACE").from_utf8()) + .stderr(predicate::str::contains("DEBUG").from_utf8()) + .stderr(predicate::str::contains("INFO").from_utf8()); + + project_root.close().unwrap(); } #[test] pub fn log_levels_trace_alias() { - let destdir = TempDir::new("trace").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "build", "--trace", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) - .stderr() - .contains("TRACE") - .stderr() - .contains("DEBUG") - .stderr() - .contains("INFO") + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); - destdir.close().unwrap(); + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "--trace"]) + .current_dir(project_root.path()) + .assert() + .success() + .stderr(predicate::str::contains("TRACE").from_utf8()) + .stderr(predicate::str::contains("DEBUG").from_utf8()) + .stderr(predicate::str::contains("INFO").from_utf8()); + + project_root.close().unwrap(); } #[test] pub fn log_levels_debug() { - let destdir = TempDir::new("debug").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "build", "-L", "debug", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) - .stderr() - .doesnt_contain("[trace]") - .stderr() - .contains("[debug]") - .stderr() - .contains("[info]") + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); - destdir.close().unwrap(); + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "-L", "debug"]) + .current_dir(project_root.path()) + .assert() + .success() + .stderr(predicate::str::contains("[trace]").not().from_utf8()) + .stderr(predicate::str::contains("[debug]").from_utf8()) + .stderr(predicate::str::contains("[info]").from_utf8()); + + project_root.close().unwrap(); } #[test] pub fn log_levels_info() { - let destdir = TempDir::new("info").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "build", "-L", "info", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) - .stderr() - .doesnt_contain("[trace]") - .stderr() - .doesnt_contain("[debug]") - .stderr() - .contains("[info]") + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); - destdir.close().unwrap(); + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "-L", "info"]) + .current_dir(project_root.path()) + .assert() + .success() + .stderr(predicate::str::contains("[trace]").not().from_utf8()) + .stderr(predicate::str::contains("[debug]").not().from_utf8()) + .stderr(predicate::str::contains("[info]").from_utf8()); + + project_root.close().unwrap(); } #[test] pub fn log_levels_silent() { - let destdir = TempDir::new("silent").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "build", "--silent", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) - .stderr() - .is("") - .stdout() - .is("") + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); - destdir.close().unwrap(); + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "--silent"]) + .current_dir(project_root.path()) + .assert() + .success() + .stdout(predicate::str::is_empty().from_utf8()) + .stderr(predicate::str::is_empty().from_utf8()); + + project_root.close().unwrap(); } #[test] pub fn clean() { - let destdir = TempDir::new("clean").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "build", "--trace", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); - assert_eq!(destdir.path().is_dir(), true); - - assert_cli::Assert::command(&[&BIN, "clean", "--trace", "-d", &dest_param]) - .current_dir(CWD.join("tests/fixtures/example")) - .unwrap(); - assert_eq!(destdir.path().is_dir(), false); + let dest = project_root.child("_dest"); + dest.assert(predicate::path::missing()); + + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "--trace", "-d", "_dest"]) + .current_dir(project_root.path()) + .assert() + .success(); + dest.assert(predicate::path::exists()); + + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["clean", "--trace", "-d", "_dest"]) + .current_dir(project_root.path()) + .assert() + .success(); + dest.assert(predicate::path::missing()); + + project_root.close().unwrap(); } #[test] pub fn clean_empty() { - assert_cli::Assert::command(&[&BIN, "clean"]) - .current_dir(CWD.join("tests/fixtures/example")) + let project_root = assert_fs::TempDir::new().unwrap(); + project_root + .copy_from("tests/fixtures/example", &["*"]) .unwrap(); + let dest = project_root.child("_dest"); + dest.assert(predicate::path::missing()); + + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["clean", "--trace", "-d", "_dest"]) + .current_dir(project_root.path()) + .assert() + .success(); + dest.assert(predicate::path::missing()); + + project_root.close().unwrap(); } #[test] pub fn init_project_can_build() { - let initdir = TempDir::new("init").expect("Tempdir not created"); - - let destdir = TempDir::new("dest").expect("Tempdir not created"); - let dest_param = destdir - .path() - .to_str() - .expect("Can't convert destdir to str") - .to_owned(); - - assert_cli::Assert::command(&[&BIN, "init", "--trace"]) - .current_dir(initdir.path()) - .unwrap(); - assert_cli::Assert::command(&[&BIN, "build", "--trace", "--drafts", "-d", &dest_param]) - .current_dir(initdir.path()) - .unwrap(); - - destdir.close().unwrap(); - initdir.close().unwrap(); + let project_root = assert_fs::TempDir::new().unwrap(); + let dest = project_root.child("_dest"); + dest.assert(predicate::path::missing()); + + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["init", "--trace"]) + .current_dir(project_root.path()) + .assert() + .success(); + dest.assert(predicate::path::missing()); + + process::Command::cargo_bin("cobalt") + .unwrap() + .args(&["build", "--trace", "-d", "_dest", "--drafts"]) + .current_dir(project_root.path()) + .assert() + .success(); + dest.assert(predicate::path::exists()); + + project_root.close().unwrap(); } diff --git a/tests/mod.rs b/tests/mod.rs index 62992c41..715edc85 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -1,17 +1,17 @@ #[macro_use] extern crate difference; +extern crate assert_fs; extern crate cobalt; extern crate error_chain; -extern crate tempdir; extern crate walkdir; -use std::fs::{self, File}; +use std::fs::File; use std::io::Read; -use std::path::{Path, PathBuf}; +use std::path::Path; +use assert_fs::prelude::*; use error_chain::ChainedError; -use tempdir::TempDir; use walkdir::WalkDir; macro_rules! assert_contains { @@ -73,28 +73,24 @@ fn assert_dirs_eq(expected: &Path, actual: &Path) { } fn run_test(name: &str) -> Result<(), cobalt::Error> { - let target = format!("tests/target/{}/", name); - let target: PathBuf = target.into(); - let mut config = cobalt::ConfigBuilder::from_cwd(format!("tests/fixtures/{}", name))?; - let destdir = TempDir::new(name).expect("Tempdir not created"); - - config.source = "./".to_owned(); - config.abs_dest = Some(destdir.path().to_owned()); + let target = assert_fs::TempDir::new().unwrap(); + target + .copy_from(format!("tests/fixtures/{}", name), &["*"]) + .unwrap(); + let mut config = cobalt::ConfigBuilder::from_cwd(target.path())?; + config.destination = "./_dest".into(); let config = config.build()?; let destination = config.destination.clone(); - - // try to create the target directory, ignore errors - fs::create_dir_all(&destination).is_ok(); - let result = cobalt::build(config); if result.is_ok() { - assert_dirs_eq(&destination, &target); + let expected = format!("tests/target/{}", name); + let expected_path = Path::new(&expected); + assert_dirs_eq(&destination, expected_path); } - - // clean up - destdir.close()?; + // Always explicitly close to catch errors, especially on Windows. + target.close()?; result }