@@ -4,8 +4,8 @@ use crate::common;
4
4
fn basic ( ) {
5
5
let name = "my-app" ;
6
6
let cmd = common:: basic_command ( name) ;
7
- common:: assert_matches_path (
8
- "tests /snapshots/basic.bash",
7
+ common:: assert_matches (
8
+ snapbox :: file! [ ".. /snapshots/basic.bash"] ,
9
9
clap_complete:: shells:: Bash ,
10
10
cmd,
11
11
name,
@@ -16,8 +16,8 @@ fn basic() {
16
16
fn feature_sample ( ) {
17
17
let name = "my-app" ;
18
18
let cmd = common:: feature_sample_command ( name) ;
19
- common:: assert_matches_path (
20
- "tests /snapshots/feature_sample.bash",
19
+ common:: assert_matches (
20
+ snapbox :: file! [ ".. /snapshots/feature_sample.bash"] ,
21
21
clap_complete:: shells:: Bash ,
22
22
cmd,
23
23
name,
@@ -28,8 +28,8 @@ fn feature_sample() {
28
28
fn special_commands ( ) {
29
29
let name = "my-app" ;
30
30
let cmd = common:: special_commands_command ( name) ;
31
- common:: assert_matches_path (
32
- "tests /snapshots/special_commands.bash",
31
+ common:: assert_matches (
32
+ snapbox :: file! [ ".. /snapshots/special_commands.bash"] ,
33
33
clap_complete:: shells:: Bash ,
34
34
cmd,
35
35
name,
@@ -40,8 +40,8 @@ fn special_commands() {
40
40
fn quoting ( ) {
41
41
let name = "my-app" ;
42
42
let cmd = common:: quoting_command ( name) ;
43
- common:: assert_matches_path (
44
- "tests /snapshots/quoting.bash",
43
+ common:: assert_matches (
44
+ snapbox :: file! [ ".. /snapshots/quoting.bash"] ,
45
45
clap_complete:: shells:: Bash ,
46
46
cmd,
47
47
name,
@@ -52,8 +52,8 @@ fn quoting() {
52
52
fn aliases ( ) {
53
53
let name = "my-app" ;
54
54
let cmd = common:: aliases_command ( name) ;
55
- common:: assert_matches_path (
56
- "tests /snapshots/aliases.bash",
55
+ common:: assert_matches (
56
+ snapbox :: file! [ ".. /snapshots/aliases.bash"] ,
57
57
clap_complete:: shells:: Bash ,
58
58
cmd,
59
59
name,
@@ -64,8 +64,8 @@ fn aliases() {
64
64
fn sub_subcommands ( ) {
65
65
let name = "my-app" ;
66
66
let cmd = common:: sub_subcommands_command ( name) ;
67
- common:: assert_matches_path (
68
- "tests /snapshots/sub_subcommands.bash",
67
+ common:: assert_matches (
68
+ snapbox :: file! [ ".. /snapshots/sub_subcommands.bash"] ,
69
69
clap_complete:: shells:: Bash ,
70
70
cmd,
71
71
name,
@@ -77,8 +77,8 @@ fn custom_bin_name() {
77
77
let name = "my-app" ;
78
78
let bin_name = "bin-name" ;
79
79
let cmd = common:: basic_command ( name) ;
80
- common:: assert_matches_path (
81
- "tests /snapshots/custom_bin_name.bash",
80
+ common:: assert_matches (
81
+ snapbox :: file! [ ".. /snapshots/custom_bin_name.bash"] ,
82
82
clap_complete:: shells:: Bash ,
83
83
cmd,
84
84
bin_name,
@@ -89,8 +89,8 @@ fn custom_bin_name() {
89
89
fn value_hint ( ) {
90
90
let name = "my-app" ;
91
91
let cmd = common:: value_hint_command ( name) ;
92
- common:: assert_matches_path (
93
- "tests /snapshots/value_hint.bash",
92
+ common:: assert_matches (
93
+ snapbox :: file! [ ".. /snapshots/value_hint.bash"] ,
94
94
clap_complete:: shells:: Bash ,
95
95
cmd,
96
96
name,
@@ -101,8 +101,8 @@ fn value_hint() {
101
101
fn value_terminator ( ) {
102
102
let name = "my-app" ;
103
103
let cmd = common:: value_terminator_command ( name) ;
104
- common:: assert_matches_path (
105
- "tests /snapshots/value_terminator.bash",
104
+ common:: assert_matches (
105
+ snapbox :: file! [ ".. /snapshots/value_terminator.bash"] ,
106
106
clap_complete:: shells:: Bash ,
107
107
cmd,
108
108
name,
@@ -124,15 +124,15 @@ fn register_minimal() {
124
124
. unwrap ( ) ;
125
125
snapbox:: Assert :: new ( )
126
126
. action_env ( "SNAPSHOTS" )
127
- . matches_path ( "tests /snapshots/register_minimal.bash", buf) ;
127
+ . matches ( snapbox :: file! [ ".. /snapshots/register_minimal.bash"] , buf) ;
128
128
}
129
129
130
130
#[ test]
131
131
fn two_multi_valued_arguments ( ) {
132
132
let name = "my-app" ;
133
133
let cmd = common:: two_multi_valued_arguments_command ( name) ;
134
- common:: assert_matches_path (
135
- "tests /snapshots/two_multi_valued_arguments.bash",
134
+ common:: assert_matches (
135
+ snapbox :: file! [ ".. /snapshots/two_multi_valued_arguments.bash"] ,
136
136
clap_complete:: shells:: Bash ,
137
137
cmd,
138
138
name,
@@ -143,8 +143,8 @@ fn two_multi_valued_arguments() {
143
143
fn subcommand_last ( ) {
144
144
let name = "my-app" ;
145
145
let cmd = common:: subcommand_last ( name) ;
146
- common:: assert_matches_path (
147
- "tests /snapshots/subcommand_last.bash",
146
+ common:: assert_matches (
147
+ snapbox :: file! [ ".. /snapshots/subcommand_last.bash"] ,
148
148
clap_complete:: shells:: Bash ,
149
149
cmd,
150
150
name,
@@ -241,7 +241,7 @@ fn complete() {
241
241
}
242
242
243
243
let input = "exhaustive hint --other \t " ;
244
- let expected = "exhaustive hint --other % exhaustive hint --other " ;
244
+ let expected = snapbox :: str! [ "exhaustive hint --other % exhaustive hint --other " ] ;
245
245
let actual = runtime. complete ( input, & term) . unwrap ( ) ;
246
246
snapbox:: assert_eq ( expected, actual) ;
247
247
}
0 commit comments