add a test
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Dec 30, 2015 at 11:05 UTC
7fe0dadcd923b45727fe9f0775deb9c49b4a0d88
1 file changed
+38
test/sharness/t0063-external.sh
new
+38
@@ -0,0 +1,38 @@
1
+#!/bin/sh
2
+#
3
+# Copyright (c) 2015 Jeromy Johnson
4
+# MIT Licensed; see the LICENSE file in this repository.
5
+#
6
+
7
+test_description="test external command functionality"
8
+
9
+. lib/test-lib.sh
10
+
11
+
12
+# set here so daemon launches with it
13
+PATH=`pwd`/bin:$PATH
14
+
15
+test_init_ipfs
16
+
17
+test_launch_ipfs_daemon
18
+
19
+test_expect_success "create fake ipfs-update bin" '
20
+ mkdir bin &&
21
+ echo "#!/bin/sh" > bin/ipfs-update &&
22
+ echo "pwd" >> bin/ipfs-update &&
23
+ chmod +x bin/ipfs-update
24
+'
25
+
26
+test_expect_success "external command runs from current user directory" '
27
+ mkdir just_for_test &&
28
+ (cd just_for_test && ipfs update) > actual
29
+'
30
+
31
+test_expect_success "output looks good" '
32
+ echo `pwd`/just_for_test > exp &&
33
+ test_cmp exp actual
34
+'
35
+
36
+test_kill_ipfs_daemon
37
+
38
+test_done