@@ -20,7 +20,7 @@ teardown() {
2020 [ $( cat $ASDF_DIR /installs/dummy/1.1/version) = " 1.1" ]
2121}
2222
23- @test " install_command installs even if the user is terrible and does not use newlines" {
23+ @test " install_command without arguments installs even if the user is terrible and does not use newlines" {
2424 cd $PROJECT_DIR
2525 echo -n ' dummy 1.2' > " .tool-versions"
2626 run asdf install
@@ -36,7 +36,7 @@ teardown() {
3636 [ " $status " -eq 0 ]
3737}
3838
39- @test " install_command should work in directory containing whitespace" {
39+ @test " install_command without arguments should work in directory containing whitespace" {
4040 WHITESPACE_DIR=" $PROJECT_DIR /whitespace\ dir"
4141 mkdir -p " $WHITESPACE_DIR "
4242 cd " $WHITESPACE_DIR "
@@ -78,7 +78,7 @@ teardown() {
7878 [ " $lines_count " -eq " 1" ]
7979}
8080
81- @test " install_command should not generate shim for subdir" {
81+ @test " install_command without arguments should not generate shim for subdir" {
8282 cd $PROJECT_DIR
8383 echo ' dummy 1.0' > $PROJECT_DIR /.tool-versions
8484
@@ -88,7 +88,7 @@ teardown() {
8888 [ ! -f " $ASDF_DIR /shims/subdir" ]
8989}
9090
91- @test " install_command generated shim should pass all arguments to executable" {
91+ @test " install_command without arguments should generate shim that passes all arguments to executable" {
9292 # asdf lib needed to run generated shims
9393 cp -rf $BATS_TEST_DIRNAME /../{bin,lib} $ASDF_DIR /
9494
@@ -114,7 +114,7 @@ teardown() {
114114 [ ! -f $ASDF_DIR /installs/dummy/1.1/version ]
115115}
116116
117- @test " install_command uses a parent directory .tool-versions file if present" {
117+ @test " install_command without arguments uses a parent directory .tool-versions file if present" {
118118 # asdf lib needed to run generated shims
119119 cp -rf $BATS_TEST_DIRNAME /../{bin,lib} $ASDF_DIR /
120120
@@ -154,11 +154,25 @@ EOM
154154 [ " $output " == " HEY 1.0 FROM dummy" ]
155155}
156156
157- @test " install_command skips comments in .tool-versions file" {
157+ @test " install command without arguments installs versions from legacy files" {
158+ echo ' legacy_version_file = yes' > $HOME /.asdfrc
159+ echo ' 1.2' >> $PROJECT_DIR /.dummy-version
158160 cd $PROJECT_DIR
159- echo -n ' # dummy 1.2' > " .tool-versions"
160161 run asdf install
161162 [ " $status " -eq 0 ]
162163 [ " $output " == " " ]
163- [ ! -f $ASDF_DIR /installs/dummy/1.2/version ]
164+ [ -f $ASDF_DIR /installs/dummy/1.2/version ]
165+ }
166+
167+ @test " install command without arguments installs versions from legacy files in parent directories" {
168+ echo ' legacy_version_file = yes' > $HOME /.asdfrc
169+ echo ' 1.2' >> $PROJECT_DIR /.dummy-version
170+
171+ mkdir -p $PROJECT_DIR /child
172+ cd $PROJECT_DIR /child
173+
174+ run asdf install
175+ [ " $status " -eq 0 ]
176+ [ " $output " == " " ]
177+ [ -f $ASDF_DIR /installs/dummy/1.2/version ]
164178}
0 commit comments