@@ -594,6 +594,8 @@ impl OutputAssert {
594
594
/// - `...` is a line-wildcard when on a line by itself
595
595
/// - `[..]` is a character-wildcard when inside a line
596
596
/// - `[EXE]` matches `.exe` on Windows
597
+ /// - `"{...}"` is a JSON value wildcard
598
+ /// - `"...": "{...}"` is a JSON key-value wildcard
597
599
/// - `\` to `/`
598
600
/// - Newlines
599
601
///
@@ -609,7 +611,7 @@ impl OutputAssert {
609
611
/// .env("stdout", "hello")
610
612
/// .env("stderr", "world")
611
613
/// .assert()
612
- /// .stdout_eq_ ("he[..]o");
614
+ /// .stdout_eq ("he[..]o");
613
615
/// ```
614
616
///
615
617
/// Can combine this with [`file!`][crate::file]
@@ -622,82 +624,18 @@ impl OutputAssert {
622
624
/// .env("stdout", "hello")
623
625
/// .env("stderr", "world")
624
626
/// .assert()
625
- /// .stdout_eq_ (file!["stdout.log"]);
627
+ /// .stdout_eq (file!["stdout.log"]);
626
628
/// ```
627
629
#[ track_caller]
628
- pub fn stdout_eq_ ( self , expected : impl IntoData ) -> Self {
630
+ pub fn stdout_eq ( self , expected : impl IntoData ) -> Self {
629
631
let expected = expected. into_data ( ) ;
630
632
self . stdout_eq_inner ( expected)
631
633
}
632
634
633
- /// Ensure the command wrote the expected data to `stdout`.
634
- ///
635
- /// ```rust,no_run
636
- /// use snapbox::cmd::Command;
637
- /// use snapbox::cmd::cargo_bin;
638
- ///
639
- /// let assert = Command::new(cargo_bin("snap-fixture"))
640
- /// .env("stdout", "hello")
641
- /// .env("stderr", "world")
642
- /// .assert()
643
- /// .stdout_eq("hello");
644
- /// ```
645
- ///
646
- /// Can combine this with [`file!`][crate::file]
647
- /// ```rust,no_run
648
- /// use snapbox::cmd::Command;
649
- /// use snapbox::cmd::cargo_bin;
650
- /// use snapbox::file;
651
- ///
652
- /// let assert = Command::new(cargo_bin("snap-fixture"))
653
- /// .env("stdout", "hello")
654
- /// .env("stderr", "world")
655
- /// .assert()
656
- /// .stdout_eq(file!["stdout.log"]);
657
- /// ```
658
- #[ track_caller]
659
- #[ deprecated(
660
- since = "0.5.11" ,
661
- note = "Replaced with `OutputAssert::stdout_eq_(expected.raw())`"
662
- ) ]
663
- pub fn stdout_eq ( self , expected : impl Into < crate :: Data > ) -> Self {
664
- let expected = expected. into ( ) ;
665
- self . stdout_eq_inner ( expected. raw ( ) )
666
- }
667
-
668
- /// Ensure the command wrote the expected data to `stdout`.
669
- ///
670
- /// ```rust,no_run
671
- /// use snapbox::cmd::Command;
672
- /// use snapbox::cmd::cargo_bin;
673
- ///
674
- /// let assert = Command::new(cargo_bin("snap-fixture"))
675
- /// .env("stdout", "hello")
676
- /// .env("stderr", "world")
677
- /// .assert()
678
- /// .stdout_matches("he[..]o");
679
- /// ```
680
- ///
681
- /// Can combine this with [`file!`][crate::file]
682
- /// ```rust,no_run
683
- /// use snapbox::cmd::Command;
684
- /// use snapbox::cmd::cargo_bin;
685
- /// use snapbox::file;
686
- ///
687
- /// let assert = Command::new(cargo_bin("snap-fixture"))
688
- /// .env("stdout", "hello")
689
- /// .env("stderr", "world")
690
- /// .assert()
691
- /// .stdout_matches(file!["stdout.log"]);
692
- /// ```
693
635
#[ track_caller]
694
- #[ deprecated(
695
- since = "0.5.11" ,
696
- note = "Replaced with `OutputAssert::stdout_eq_(expected)`"
697
- ) ]
698
- pub fn stdout_matches ( self , expected : impl Into < crate :: Data > ) -> Self {
699
- let expected = expected. into ( ) ;
700
- self . stdout_eq_inner ( expected)
636
+ #[ deprecated( since = "0.6.0" , note = "Replaced with `OutputAssert::stdout_eq`" ) ]
637
+ pub fn stdout_eq_ ( self , expected : impl IntoData ) -> Self {
638
+ self . stdout_eq ( expected)
701
639
}
702
640
703
641
#[ track_caller]
@@ -716,6 +654,8 @@ impl OutputAssert {
716
654
/// - `...` is a line-wildcard when on a line by itself
717
655
/// - `[..]` is a character-wildcard when inside a line
718
656
/// - `[EXE]` matches `.exe` on Windows
657
+ /// - `"{...}"` is a JSON value wildcard
658
+ /// - `"...": "{...}"` is a JSON key-value wildcard
719
659
/// - `\` to `/`
720
660
/// - Newlines
721
661
///
@@ -731,7 +671,7 @@ impl OutputAssert {
731
671
/// .env("stdout", "hello")
732
672
/// .env("stderr", "world")
733
673
/// .assert()
734
- /// .stderr_eq_ ("wo[..]d");
674
+ /// .stderr_eq ("wo[..]d");
735
675
/// ```
736
676
///
737
677
/// Can combine this with [`file!`][crate::file]
@@ -744,82 +684,18 @@ impl OutputAssert {
744
684
/// .env("stdout", "hello")
745
685
/// .env("stderr", "world")
746
686
/// .assert()
747
- /// .stderr_eq_ (file!["stderr.log"]);
687
+ /// .stderr_eq (file!["stderr.log"]);
748
688
/// ```
749
689
#[ track_caller]
750
- pub fn stderr_eq_ ( self , expected : impl IntoData ) -> Self {
690
+ pub fn stderr_eq ( self , expected : impl IntoData ) -> Self {
751
691
let expected = expected. into_data ( ) ;
752
692
self . stderr_eq_inner ( expected)
753
693
}
754
694
755
- /// Ensure the command wrote the expected data to `stderr`.
756
- ///
757
- /// ```rust,no_run
758
- /// use snapbox::cmd::Command;
759
- /// use snapbox::cmd::cargo_bin;
760
- ///
761
- /// let assert = Command::new(cargo_bin("snap-fixture"))
762
- /// .env("stdout", "hello")
763
- /// .env("stderr", "world")
764
- /// .assert()
765
- /// .stderr_eq("world");
766
- /// ```
767
- ///
768
- /// Can combine this with [`file!`][crate::file]
769
- /// ```rust,no_run
770
- /// use snapbox::cmd::Command;
771
- /// use snapbox::cmd::cargo_bin;
772
- /// use snapbox::file;
773
- ///
774
- /// let assert = Command::new(cargo_bin("snap-fixture"))
775
- /// .env("stdout", "hello")
776
- /// .env("stderr", "world")
777
- /// .assert()
778
- /// .stderr_eq(file!["stderr.log"]);
779
- /// ```
780
- #[ track_caller]
781
- #[ deprecated(
782
- since = "0.5.11" ,
783
- note = "Replaced with `OutputAssert::stderr_eq_(expected.raw())`"
784
- ) ]
785
- pub fn stderr_eq ( self , expected : impl Into < crate :: Data > ) -> Self {
786
- let expected = expected. into ( ) ;
787
- self . stderr_eq_inner ( expected. raw ( ) )
788
- }
789
-
790
- /// Ensure the command wrote the expected data to `stderr`.
791
- ///
792
- /// ```rust,no_run
793
- /// use snapbox::cmd::Command;
794
- /// use snapbox::cmd::cargo_bin;
795
- ///
796
- /// let assert = Command::new(cargo_bin("snap-fixture"))
797
- /// .env("stdout", "hello")
798
- /// .env("stderr", "world")
799
- /// .assert()
800
- /// .stderr_matches("wo[..]d");
801
- /// ```
802
- ///
803
- /// Can combine this with [`file!`][crate::file]
804
- /// ```rust,no_run
805
- /// use snapbox::cmd::Command;
806
- /// use snapbox::cmd::cargo_bin;
807
- /// use snapbox::file;
808
- ///
809
- /// let assert = Command::new(cargo_bin("snap-fixture"))
810
- /// .env("stdout", "hello")
811
- /// .env("stderr", "world")
812
- /// .assert()
813
- /// .stderr_matches(file!["stderr.log"]);
814
- /// ```
815
695
#[ track_caller]
816
- #[ deprecated(
817
- since = "0.5.11" ,
818
- note = "Replaced with `OutputAssert::stderr_eq_(expected)`"
819
- ) ]
820
- pub fn stderr_matches ( self , expected : impl Into < crate :: Data > ) -> Self {
821
- let expected = expected. into ( ) ;
822
- self . stderr_eq_inner ( expected)
696
+ #[ deprecated( since = "0.6.0" , note = "Replaced with `OutputAssert::stderr_eq`" ) ]
697
+ pub fn stderr_eq_ ( self , expected : impl IntoData ) -> Self {
698
+ self . stderr_eq ( expected)
823
699
}
824
700
825
701
#[ track_caller]
0 commit comments