Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
sharness: t0010- jsipfs version (#518)
Browse files Browse the repository at this point in the history
* t0010: add failing tests

* sharness
  • Loading branch information
chriscool authored and daviddias committed Feb 13, 2017
1 parent 1c12f46 commit 7cf60bb
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions test/sharness/t0010-basic-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ test_description="Test installation and some basic commands"
. lib/test-lib.sh

test_expect_success "current dir is writable" '
echo "It works!" >test.txt
echo "It works!" > test.txt
'

test_expect_success "ipfs version succeeds" '
ipfs version >version.txt
ipfs version > version.txt
'

test_expect_success "ipfs version shows js-ipfs" '
grep "js-ipfs" version.txt >/dev/null ||
grep "js-ipfs" version.txt > /dev/null ||
test_fsh cat version.txt
'

Expand All @@ -26,4 +26,47 @@ test_expect_success "ipfs version output looks good" '
test_fsh cat version.txt
'

test_expect_success "ipfs version --all has all required fields" '
ipfs version --all > version_all.txt &&
grep "js-ipfs version" version_all.txt
'

test_expect_success "ipfs help succeeds" '
ipfs help > help.txt
'

# test_expect_success "ipfs help output looks good" '
# egrep -i "^Usage" help.txt > /dev/null &&
# egrep "ipfs .* <command>" help.txt >/dev/null ||
# test_fsh cat help.txt
# '

test_expect_success "'ipfs commands' succeeds" '
ipfs commands > commands.txt
'

test_expect_success "'ipfs commands' output looks good" '
grep "add" commands.txt &&
grep "daemon" commands.txt &&
grep "update" commands.txt
'

# test_expect_success "All commands accept --help" '
# while read -r cmd
# do
# echo "running: $cmd --help"
# $cmd --help </dev/null >/dev/null || return
# done <commands.txt
# '

# test_expect_success "'ipfs commands --flags' succeeds" '
# ipfs commands --flags >commands.txt
# '

# test_expect_success "'ipfs commands --flags' output looks good" '
# grep "ipfs pin add --recursive / ipfs pin add -r" commands.txt &&
# grep "ipfs id --format / ipfs id -f" commands.txt &&
# grep "ipfs repo gc --quiet / ipfs repo gc -q" commands.txt
# '

test_done

0 comments on commit 7cf60bb

Please sign in to comment.