kubo/test/sharness/t0063-external.sh
Łukasz Magiera 6a40c37b94 sharness: 2 space indent
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2017-10-04 13:39:14 +02:00

39 lines
740 B
Bash
Executable File

#!/bin/sh
#
# Copyright (c) 2015 Jeromy Johnson
# MIT Licensed; see the LICENSE file in this repository.
#
test_description="test external command functionality"
. lib/test-lib.sh
# set here so daemon launches with it
PATH=`pwd`/bin:$PATH
test_init_ipfs
test_launch_ipfs_daemon
test_expect_success "create fake ipfs-update bin" '
mkdir bin &&
echo "#!/bin/sh" > bin/ipfs-update &&
echo "pwd" >> bin/ipfs-update &&
chmod +x bin/ipfs-update
'
test_expect_success "external command runs from current user directory" '
mkdir just_for_test &&
(cd just_for_test && ipfs update) > actual
'
test_expect_success "output looks good" '
echo `pwd`/just_for_test > exp &&
test_cmp exp actual
'
test_kill_ipfs_daemon
test_done