1- //! `process::Output` assertions.
1+ //! [`Output`][Output] assertions.
2+ //!
3+ //! [Output]: https://doc.rust-lang.org/std/process/struct.Output.html
24
35use std:: fmt;
46use std:: process;
@@ -10,7 +12,7 @@ use predicates::str::PredicateStrExt;
1012use errors:: dump_buffer;
1113use errors:: output_fmt;
1214
13- /// Assert the state of an `Output`.
15+ /// Assert the state of an [ `Output`][Output] .
1416///
1517/// # Examples
1618///
@@ -24,8 +26,10 @@ use errors::output_fmt;
2426/// .assert()
2527/// .success();
2628/// ```
29+ ///
30+ /// [Output]: https://doc.rust-lang.org/std/process/struct.Output.html
2731pub trait OutputAssertExt {
28- /// Wrap with an interface for that provides assertions on the `process:: Output`.
32+ /// Wrap with an interface for that provides assertions on the [` Output`][Output] .
2933 ///
3034 /// # Examples
3135 ///
@@ -39,6 +43,8 @@ pub trait OutputAssertExt {
3943 /// .assert()
4044 /// .success();
4145 /// ```
46+ ///
47+ /// [Output]: https://doc.rust-lang.org/std/process/struct.Output.html
4248 fn assert ( self ) -> Assert ;
4349}
4450
@@ -55,9 +61,9 @@ impl<'c> OutputAssertExt for &'c mut process::Command {
5561 }
5662}
5763
58- /// Assert the state of an `Output`.
64+ /// Assert the state of an [ `Output`][Output] .
5965///
60- /// Create an `Assert` through the `OutputAssertExt` trait.
66+ /// Create an `Assert` through the [ `OutputAssertExt`][OutputAssertExt] trait.
6167///
6268/// # Examples
6369///
@@ -71,13 +77,18 @@ impl<'c> OutputAssertExt for &'c mut process::Command {
7177/// .assert()
7278/// .success();
7379/// ```
80+ ///
81+ /// [Output]: https://doc.rust-lang.org/std/process/struct.Output.html
82+ /// [OutputAssertExt]: trait.OutputAssertExt.html
7483pub struct Assert {
7584 output : process:: Output ,
7685 context : Vec < ( & ' static str , Box < fmt:: Display > ) > ,
7786}
7887
7988impl Assert {
80- /// Create an `Assert` for a given `Output`.
89+ /// Create an `Assert` for a given [`Output`][Output].
90+ ///
91+ /// [Output]: https://doc.rust-lang.org/std/process/struct.Output.html
8192 pub fn new ( output : process:: Output ) -> Self {
8293 Self {
8394 output,
@@ -94,7 +105,9 @@ impl Assert {
94105 self
95106 }
96107
97- /// Access the contained `std::process::Output`.
108+ /// Access the contained [`Output`][Output].
109+ ///
110+ /// [Output]: https://doc.rust-lang.org/std/process/struct.Output.html
98111 pub fn get_output ( & self ) -> & process:: Output {
99112 & self . output
100113 }
@@ -307,7 +320,8 @@ impl fmt::Debug for Assert {
307320 }
308321}
309322
310- /// Used by `Assert::code` to convert `Self` into the needed `Predicate<i32>`.
323+ /// Used by [`Assert::code`][Assert_code] to convert `Self` into the needed
324+ /// [`Predicate<i32>`][Predicate].
311325///
312326/// # Examples
313327///
@@ -328,6 +342,9 @@ impl fmt::Debug for Assert {
328342/// .assert()
329343/// .code(predicates::ord::eq(42));
330344/// ```
345+ ///
346+ /// [Assert_code]: struct.Assert.html#method.code
347+ /// [Predicate]: https://docs.rs/predicates/0.5.2/predicates/trait.Predicate.html
331348pub trait IntoCodePredicate < P >
332349where
333350 P : predicates:: Predicate < i32 > ,
@@ -374,7 +391,12 @@ impl IntoCodePredicate<predicates::iter::InPredicate<i32>> for &'static [i32] {
374391 }
375392}
376393
377- /// Used by `Assert` to convert Self into the needed `Predicate<[u8]>`.
394+ /// Used by [`Assert::stdout`][Assert_stdout] and [`Assert::stderr`][Assert_stderr] to convert Self
395+ /// into the needed [`Predicate<[u8]>`][Predicate].
396+ ///
397+ /// [Assert_stdout]: struct.Assert.html#method.stdout
398+ /// [Assert_stderr]: struct.Assert.html#method.stderr
399+ /// [Predicate]: https://docs.rs/predicates/0.5.2/predicates/trait.Predicate.html
378400pub trait IntoOutputPredicate < P >
379401where
380402 P : predicates:: Predicate < [ u8 ] > ,
@@ -398,7 +420,10 @@ where
398420}
399421
400422// Keep `predicates` concrete Predicates out of our public API.
401- /// Predicate used by `IntoOutputPredicate` for bytes
423+ /// [Predicate][Predicate] used by [`IntoOutputPredicate`][IntoOutputPredicate] for bytes.
424+ ///
425+ /// [IntoOutputPredicate]: trait.IntoOutputPredicate.html
426+ /// [Predicate]: https://docs.rs/predicates/0.5.2/predicates/trait.Predicate.html
402427#[ derive( Debug ) ]
403428pub struct BytesContentOutputPredicate ( predicates:: ord:: EqPredicate < & ' static [ u8 ] > ) ;
404429
@@ -430,7 +455,10 @@ impl IntoOutputPredicate<BytesContentOutputPredicate> for &'static [u8] {
430455}
431456
432457// Keep `predicates` concrete Predicates out of our public API.
433- /// Predicate used by `IntoOutputPredicate` for `str`
458+ /// [Predicate][Predicate] used by [`IntoOutputPredicate`][IntoOutputPredicate] for `str`.
459+ ///
460+ /// [IntoOutputPredicate]: trait.IntoOutputPredicate.html
461+ /// [Predicate]: https://docs.rs/predicates/0.5.2/predicates/trait.Predicate.html
434462#[ derive( Debug , Clone ) ]
435463pub struct StrContentOutputPredicate (
436464 predicates:: str:: Utf8Predicate < predicates:: str:: DifferencePredicate > ,
0 commit comments