Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
ee10b410
Commit
ee10b410
authored
9 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1293 from rht/cleanup-cat-error
Add test for cat error message when `ipfs init` hasn't been run
parents
6f155239
f5d5095b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
repo/fsrepo/fsrepo.go
repo/fsrepo/fsrepo.go
+1
-1
test/sharness/t0020-init.sh
test/sharness/t0020-init.sh
+15
-1
No files found.
repo/fsrepo/fsrepo.go
View file @
ee10b410
...
...
@@ -52,7 +52,7 @@ type NoRepoError struct {
var
_
error
=
NoRepoError
{}
func
(
err
NoRepoError
)
Error
()
string
{
return
fmt
.
Sprintf
(
"no ipfs repo found in
'
%s
'.
please run: ipfs init
"
,
err
.
Path
)
return
fmt
.
Sprintf
(
"no ipfs repo found in %s
.
\n
please run: ipfs init"
,
err
.
Path
)
}
const
(
...
...
This diff is collapsed.
Click to expand it.
test/sharness/t0020-init.sh
View file @
ee10b410
...
...
@@ -21,9 +21,23 @@ test_expect_success "ipfs init fails" '
test_expect_success
"ipfs init output looks good"
'
echo "Error: failed to take lock at $IPFS_PATH: permission denied" > init_fail_exp &&
test_cmp init_fail_
out
init_fail_
exp
test_cmp init_fail_
exp
init_fail_
out
'
# test no repo error message
# this applies to `ipfs add sth`, `ipfs refs <hash>`
test_expect_success
"ipfs cat fails"
'
export IPFS_PATH="$(pwd)/.ipfs" &&
test_must_fail ipfs cat Qmaa4Rw81a3a1VEx4LxB7HADUAXvZFhCoRdBzsMZyZmqHD 2> cat_fail_out
'
test_expect_success
"ipfs cat no repo message looks good"
'
echo "Error: no ipfs repo found in $IPFS_PATH." > cat_fail_exp &&
echo "please run: ipfs init" >> cat_fail_exp &&
test_cmp cat_fail_exp cat_fail_out
'
# test that init succeeds
test_expect_success
"ipfs init succeeds"
'
export IPFS_PATH="$(pwd)/.ipfs" &&
BITS="2048" &&
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment