@@ -121,35 +121,35 @@ def mock_connect_result(stderr, exit_status)
121
121
it "error message for bad sudo password" do
122
122
backend . stubs ( :run_command ) . returns ( mock_connect_result ( "Sorry, try again" , 1 ) )
123
123
lc = cls . new ( backend , { sudo : true } )
124
- err = _ { lc . verify } . must_raise Train ::UserError
124
+ err = _ { lc . verify! } . must_raise Train ::UserError
125
125
_ ( err . message ) . must_match ( /Sudo failed: Wrong sudo password./ )
126
126
end
127
127
128
128
it "error message for sudo password required" do
129
129
backend . stubs ( :run_command ) . returns ( mock_connect_result ( "sudo: no tty present and no askpass program specified" , 1 ) )
130
130
lc = cls . new ( backend , { sudo : true } )
131
- err = _ { lc . verify } . must_raise Train ::UserError
131
+ err = _ { lc . verify! } . must_raise Train ::UserError
132
132
_ ( err . message ) . must_match ( /Sudo requires a password, please configure it./ )
133
133
end
134
134
135
135
it "error message for sudo: command not found" do
136
136
backend . stubs ( :run_command ) . returns ( mock_connect_result ( "sudo: command not found" , 1 ) )
137
137
lc = cls . new ( backend , { sudo : true } )
138
- err = _ { lc . verify } . must_raise Train ::UserError
138
+ err = _ { lc . verify! } . must_raise Train ::UserError
139
139
_ ( err . message ) . must_match ( /Can't find sudo command. Please either install and configure it on the target or deactivate sudo./ )
140
140
end
141
141
142
142
it "error message for requires tty" do
143
143
backend . stubs ( :run_command ) . returns ( mock_connect_result ( "sudo: sorry, you must have a tty to run sudo" , 1 ) )
144
144
lc = cls . new ( backend , { sudo : true } )
145
- err = _ { lc . verify } . must_raise Train ::UserError
145
+ err = _ { lc . verify! } . must_raise Train ::UserError
146
146
_ ( err . message ) . must_match ( /Sudo failed: Sudo requires a TTY. Please see the README/ )
147
147
end
148
148
149
149
it "error message for other sudo related errors" do
150
150
backend . stubs ( :run_command ) . returns ( mock_connect_result ( "Other sudo related error" , 1 ) )
151
151
lc = cls . new ( backend , { sudo : true } )
152
- err = _ { lc . verify } . must_raise Train ::UserError
152
+ err = _ { lc . verify! } . must_raise Train ::UserError
153
153
_ ( err . message ) . must_match ( /Other sudo related error/ )
154
154
end
155
155
end
0 commit comments