1- use fs_err as fs;
2-
31use crate :: { RvOutput , RvTest } ;
4- use owo_colors:: OwoColorize ;
5- use rv_cache:: rm_rf;
62
73impl RvTest {
84 pub fn tool_run ( & mut self , args : & [ & str ] ) -> RvOutput {
@@ -15,9 +11,13 @@ impl RvTest {
1511}
1612
1713mod test {
14+ use owo_colors:: OwoColorize as _;
15+ use rv_cache:: rm_rf;
16+
17+ use crate :: RvTest ;
18+
1819 #[ test]
1920 fn test_tool_run_works ( ) {
20- panic ! ( "test failed" ) ;
2121 let mut test = RvTest :: new ( ) ;
2222
2323 let releases_mock = test. mock_releases_all_platforms ( [ "4.0.0" ] . to_vec ( ) ) ;
@@ -48,13 +48,22 @@ mod test {
4848 #[ test]
4949 fn test_tool_run_works_with_namespaced_gem ( ) {
5050 let mut test = RvTest :: new ( ) ;
51+ test. namespace = Some ( "@indirect" . to_string ( ) ) ;
5152
5253 let releases_mock = test. mock_releases_all_platforms ( [ "4.0.0" ] . to_vec ( ) ) ;
5354 let ruby_mock = test. mock_ruby_download ( "4.0.0" ) . create ( ) ;
5455 let info_endpoint_mock = test. mock_info_endpoint ( "indirect" ) . create ( ) ;
5556 let tarball_mock = test. mock_gem_download ( "indirect-1.2.0.gem" ) . create ( ) ;
5657
57- let output = test. tool_run ( & [ "@indirect/indirect" ] ) ;
58+ // skip using `tool_run()` specifically so we do not include the namespace
59+ // in the gem server URL, and test that it gets added from the gem name.
60+ let output = test. rv ( & [
61+ "tool" ,
62+ "run" ,
63+ "--gem-server" ,
64+ & test. server_url ( ) ,
65+ "@indirect/indirect" ,
66+ ] ) ;
5867
5968 let tool_home = "/tmp/home/.local/share/rv/tools/indirect@1.2.0" ;
6069 let expected_info_message = format ! (
0 commit comments