mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Add unit tests for managing latest stable versions
This commit is contained in:
parent
62ef77670d
commit
c11409583f
@ -188,3 +188,15 @@ EOM
|
||||
[ "$output" == "" ]
|
||||
[ -f $ASDF_DIR/installs/dummy/1.2/version ]
|
||||
}
|
||||
|
||||
@test "install_command latest installs latest stable version" {
|
||||
run asdf install dummy latest
|
||||
[ "$status" -eq 0 ]
|
||||
[ $(cat $ASDF_DIR/installs/dummy/2.0/version) = "2.0" ]
|
||||
}
|
||||
|
||||
@test "install_command latest:version installs latest stable version that matches the given string" {
|
||||
run asdf install dummy latest:1
|
||||
[ "$status" -eq 0 ]
|
||||
[ $(cat $ASDF_DIR/installs/dummy/1.1/version) = "1.1" ]
|
||||
}
|
||||
|
24
test/latest_command.bats
Normal file
24
test/latest_command.bats
Normal file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helpers
|
||||
|
||||
setup() {
|
||||
setup_asdf_dir
|
||||
install_dummy_plugin
|
||||
}
|
||||
|
||||
teardown() {
|
||||
clean_asdf_dir
|
||||
}
|
||||
|
||||
@test "latest_command shows latest stable version" {
|
||||
run asdf latest dummy
|
||||
[ "$(echo -e "2.0")" == "$output" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "latest_command with version shows latest stable version that matches the given string" {
|
||||
run asdf latest dummy 1
|
||||
[ "$(echo -e "1.1")" == "$output" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
@ -37,3 +37,15 @@ teardown() {
|
||||
[ "$(echo -e " 1.0\n 1.1")" == "$output" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "list_all_command lists available versions" {
|
||||
run asdf list-all dummy
|
||||
[ "$(echo -e "1.0\n1.1\n2.0")" == "$output" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "list_all_command with version filters available versions" {
|
||||
run asdf list-all dummy 1
|
||||
[ "$(echo -e "1.0\n1.1")" == "$output" ]
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user