Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Add tests for migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vergissberlin committed Jan 15, 2019
1 parent 8a34187 commit 4cf2b0d
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@

# Exclusion
/ci/variables/credentials.yml
/tests/tmp/
33 changes: 33 additions & 0 deletions tests/acceptance/migrate.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bats

####################################################################################
# Bashlight : 0.2.1
# Copyright : 2019, MIT
# Author : André Lademann <[email protected]>
# Repository : https://github.com/vergissberlin/bashlight
####################################################################################

# @link https://github.com/tkuchiki/bats-travis-ci

load helper

BATS_TEST_NAME="Migration test"
BATS_TEST_DESCRIPTION="Test migrations after breaking updates"
TEMP_DIRECTORY=tests/tmp

setup() {
echo "setup ${BATS_TEST_NAME} ..." >> ./bats.log
mkdir -p ${TEMP_DIRECTORY}
cp -r tests/fixtures/0.2.0/ ${TEMP_DIRECTORY}
}

teardown() {
echo "teardown ${BATS_TEST_NAME} ..." >> ./bats.log
rm -rf ${TEMP_DIRECTORY}
}

@test "Migration is needed: returns 1 if migration was successfull" {
skip "Not implemented yet"
# run HOME="$(pwd)/${TEMP_DIRECTORY}" migrate.bash
# $[ ! "$output" = "Migrate installation path from ~/bashlight to ~/.bin/bashlight" ]
}
3 changes: 3 additions & 0 deletions tests/fixtures/0.2.0/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ -f ~/bashlight/bashlight ]; then
. ~/bashlight/bashlight
fi
3 changes: 3 additions & 0 deletions tests/fixtures/0.2.0/.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ -f ~/bashlight/bashlight ]; then
. ~/bashlight/bashlight
fi
14 changes: 14 additions & 0 deletions tests/suite.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

####################################################################################
# Bashlight : 0.2.1
# Copyright : 2019, MIT
# Author : André Lademann <[email protected]>
# Repository : https://github.com/vergissberlin/bashlight
####################################################################################

bats ./tests/acceptance/
shellcheck -x ./bashlight
shellcheck -x ./*.bash
shellcheck -x ./**/*.bash
yamllint .

0 comments on commit 4cf2b0d

Please sign in to comment.