Skip to content

Commit

Permalink
Fix false positive in bats test caused by sstephenson/bats#89
Browse files Browse the repository at this point in the history
  • Loading branch information
alza-bitz committed Jan 25, 2016
1 parent 5a7e621 commit de2dee4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/firefox_addon
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ensure_profile() {
[[ $? -eq 0 ]] || fail "couldn't determine profile path" "$_stdout"
[[ $_stdout =~ Success:\ created\ profile\ \'(.+)\'\ at\ \'(.+)\' ]] || fail "couldn't determine profile path"
local _profile_path=${BASH_REMATCH[2]}
result "$_result_name" ${profile_path%/*}
result "$_result_name" ${_profile_path%/*}
}

url_slug() {
Expand Down
6 changes: 4 additions & 2 deletions tests/container-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ docker_exec_d() {
}

docker_exec_sh() {
docker exec $DOCKER_CONTAINER_NAME sh -c '$@' > /dev/null
# workaround for https://github.com/sstephenson/bats/issues/89
local IFS=' '
docker exec $DOCKER_CONTAINER_NAME sh -c "$*" > /dev/null
}

ansible_exec_module() {
Expand Down Expand Up @@ -69,7 +71,7 @@ setup() {
[[ $output =~ changed.*true ]]
run ansible_exec_module firefox_addon "url=$addon_url state=absent display=:1"
[[ $output =~ changed.*true ]]
docker_exec_sh test ! -e "/usr/lib64/firefox/browser/extensions/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}"
docker_exec_sh test ! -e "~/.mozilla/firefox/*.default/extensions/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}"
}

@test "Module exec with state present twice and check idempotent" {
Expand Down

0 comments on commit de2dee4

Please sign in to comment.