2016-12-10 12:54:22 -07:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helpers
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
setup_asdf_dir
|
|
|
|
install_dummy_plugin
|
|
|
|
}
|
|
|
|
|
|
|
|
teardown() {
|
|
|
|
clean_asdf_dir
|
|
|
|
}
|
|
|
|
|
2018-04-16 15:37:22 -07:00
|
|
|
@test "list_command should list plugins with installed versions" {
|
2019-01-20 01:13:20 -07:00
|
|
|
run asdf install dummy 1.0
|
|
|
|
run asdf install dummy 1.1
|
|
|
|
run asdf list
|
2018-06-01 08:15:40 -07:00
|
|
|
[ "$(echo -e "dummy\n 1.0\n 1.1")" == "$output" ]
|
2018-04-16 15:37:22 -07:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
|
|
|
|
2018-12-27 18:13:16 -07:00
|
|
|
@test "list_command should continue listing even when no version is installed for any of the plugins" {
|
|
|
|
run install_mock_plugin "dummy"
|
|
|
|
run install_mock_plugin "mummy"
|
|
|
|
run install_mock_plugin "tummy"
|
2019-01-20 01:13:20 -07:00
|
|
|
run asdf install dummy 1.0
|
|
|
|
run asdf install tummy 2.0
|
|
|
|
run asdf list
|
2018-12-27 18:13:16 -07:00
|
|
|
[ "$(echo -e "dummy\n 1.0\nmummy\nNo versions installed\ntummy\n 2.0")" == "$output" ]
|
|
|
|
[ "$status" -eq 0 ]
|
2016-12-10 12:54:22 -07:00
|
|
|
}
|
|
|
|
|
2018-04-16 15:37:22 -07:00
|
|
|
@test "list_command with plugin should list installed versions" {
|
2019-01-20 01:13:20 -07:00
|
|
|
run asdf install dummy 1.0
|
|
|
|
run asdf install dummy 1.1
|
|
|
|
run asdf list dummy
|
2018-06-01 08:15:40 -07:00
|
|
|
[ "$(echo -e " 1.0\n 1.1")" == "$output" ]
|
2016-12-10 12:54:22 -07:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
2019-11-22 11:37:53 -07:00
|
|
|
|
|
|
|
@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 ]
|
|
|
|
}
|