Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ekalinin committed Oct 10, 2014
1 parent 276efb6 commit f1be403
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion tests/help.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ load test_helper
local usage_b=$(nv_bold "Usage")
run nv
assert_success
assert_equal "${lines[0]}" "nv 0.7.2"
assert_equal "${lines[0]}" "nv 0.7.5"
assert_equal "${lines[1]}" "${usage_b}: nv <subcommand>"
assert_equal "${lines[2]}" "Subcommands:"
}
41 changes: 22 additions & 19 deletions tests/ls-commands.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,27 @@ load test_helper
@test "ls-commands: list commands" {
run nv ls-commands
assert_success
local pos=0

assert_equal " activate Activate environment (aliases: on, use)" "${lines[0]}"
assert_equal " autoon Mark current directory for environment auto activating" "${lines[1]}"
assert_equal " cp Copy environment" "${lines[2]}"
assert_equal " current Output current environment's name" "${lines[3]}"
assert_equal " deactivate Deactivate environment (alias: off)" "${lines[4]}"
assert_equal " do Execute something inside environment" "${lines[5]}"
assert_equal " ls List environments" "${lines[6]}"
assert_equal " ls-cache List locally cached verions (no need to download & build)" "${lines[7]}"
assert_equal " ls-commands List available commands" "${lines[8]}"
assert_equal " ls-plugins List available plugins" "${lines[9]}"
assert_equal " ls-versions Lists available versions for plugins" "${lines[10]}"
assert_equal " mk Create environment" "${lines[11]}"
assert_equal " mv Move (rename) environment" "${lines[12]}"
assert_equal " off Deactivate environment (alias: deactivate)" "${lines[13]}"
assert_equal " on Activate environment (aliases: activate, use)" "${lines[14]}"
assert_equal " rm Delete environment" "${lines[15]}"
assert_equal " rm-cache Delete cache entry" "${lines[16]}"
assert_equal " use Activate environment (aliases: activate, on)" "${lines[17]}"
assert_equal " version Display the version number" "${lines[18]}"
assert_equal " activate Activate environment (aliases: on, use)" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " autoon Mark current directory for environment auto activating" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " cp Copy environment" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " current Output current environment's name" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " deactivate Deactivate environment (alias: off)" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " do Execute something inside environment" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " export Export environment into tar archive" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " import Import archive as environment" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " ls List environments" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " ls-cache List locally cached verions (no need to download & build)" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " ls-commands List available commands" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " ls-plugins List available plugins" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " ls-versions Lists available versions for plugins" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " mk Create environment" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " mv Move (rename) environment" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " off Deactivate environment (alias: deactivate)" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " on Activate environment (aliases: activate, use)" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " rm Delete environment" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " rm-cache Delete cache entry" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " use Activate environment (aliases: activate, on)" "${lines[$pos]}"; pos=$((pos+1));
assert_equal " version Display the version number" "${lines[$pos]}"; pos=$((pos+1));
}
1 change: 0 additions & 1 deletion tests/ls-versions.bats
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ load test_helper
assert_equal "${lines[0]}" $line_0
assert_equal "${lines[1]}" "0.1 0.2 0.3 0.3.1 0.4 "
assert_equal "${lines[2]}" "0.5 0.6 0.7 0.8 0.9 "
assert_equal "${lines[3]}" "0.10 0.11.0 "
}
2 changes: 1 addition & 1 deletion tests/version.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ load test_helper
@test "version: output version" {
run nv version
assert_success
assert_output "nv 0.7.4"
assert_output "nv 0.7.5"
}

0 comments on commit f1be403

Please sign in to comment.