Skip to content

Commit

Permalink
split properties tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmccracken committed Dec 25, 2024
1 parent 35199a2 commit 238ca8d
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 37 deletions.
37 changes: 0 additions & 37 deletions ws_tool/test/bootstrap_doctor.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,6 @@ setup (){
. "$PROJECT_ROOT/ws_tool/lib/bootstrap_doctor.bash"
}

@test "prop_ws_check_workstation_dir" {
ws_unset_settings
WORKSTATION_DIR="$(_mktemp "ws-dir")"
WORKSTATION_VERSION=workcomp
. "$PROJECT_ROOT/ws_tool/lib/settings.bash"

run prop_ws_check_workstation_dir
assert_failure

run prop_ws_check_workstation_dir_fix
assert_success

run prop_ws_check_workstation_dir
assert_success
}

@test "prop_ws_check_workstation_repo" {
ws_unset_settings
WORKSTATION_DIR="$(_mktemp "ws-dir")"
WORKSTATION_VERSION=workcomp
. "$PROJECT_ROOT/ws_tool/lib/settings.bash"

# set up the workstation dir, but wont set up git, just project source
run prop_ws_check_workstation_dir_fix
assert_success

run prop_ws_check_workstation_repo
assert_failure

# WORKSTATION_REPO_GIT_ORIGIN=https://github.com/joelmccracken/workstation.git
run prop_ws_check_workstation_repo_fix
assert_success

run prop_ws_check_workstation_repo
assert_success
}

props_test_tmp_file=
declare -a prop_exec_hist

Expand Down
42 changes: 42 additions & 0 deletions ws_tool/test/properties.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
setup (){
load 'test_helper/helper'
_setup_common
. "$PROJECT_ROOT/ws_tool/lib/properties.bash"
}

@test "prop_ws_check_workstation_dir" {
ws_unset_settings
WORKSTATION_DIR="$(_mktemp "ws-dir")"
WORKSTATION_VERSION=workcomp
. "$PROJECT_ROOT/ws_tool/lib/settings.bash"

run prop_ws_check_workstation_dir
assert_failure

run prop_ws_check_workstation_dir_fix
assert_success

run prop_ws_check_workstation_dir
assert_success
}

@test "prop_ws_check_workstation_repo" {
ws_unset_settings
WORKSTATION_DIR="$(_mktemp "ws-dir")"
WORKSTATION_VERSION=workcomp
. "$PROJECT_ROOT/ws_tool/lib/settings.bash"

# set up the workstation dir, but wont set up git, just project source
run prop_ws_check_workstation_dir_fix
assert_success

run prop_ws_check_workstation_repo
assert_failure

# WORKSTATION_REPO_GIT_ORIGIN=https://github.com/joelmccracken/workstation.git
run prop_ws_check_workstation_repo_fix
assert_success

run prop_ws_check_workstation_repo
assert_success
}

0 comments on commit 238ca8d

Please sign in to comment.