generated from demus/basic-rpm-template
33 lines
653 B
Bash
33 lines
653 B
Bash
#!/usr/bin/env bats
|
|
|
|
load 'test_helper'
|
|
bats_load_library 'bats-file'
|
|
bats_load_library 'bats-mock'
|
|
|
|
setup() {
|
|
load ../spec-update-artifacts.sh
|
|
common_setup
|
|
}
|
|
|
|
# bats file_tags=download_sources
|
|
|
|
@test "Missing spec variable skips action" {
|
|
stub spectool ''
|
|
|
|
_download_sources
|
|
|
|
assert_file_exists ${SPECTOOL_STUB_PLAN}
|
|
# unstub fails the test because spectool wasn't invoked
|
|
"$BATS_MOCK_REAL_rm" -rf "${BATS_MOCK_TMPDIR}" || true
|
|
}
|
|
|
|
@test "Correct parameters are passed to spectool" {
|
|
stub spectool '-g gurli.spec : echo OK'
|
|
|
|
export SPEC_FILE=gurli.spec
|
|
run _download_sources
|
|
|
|
assert_success
|
|
unstub spectool
|
|
}
|