Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
e66aa25f
Commit
e66aa25f
authored
9 years ago
by
Makpoc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail the test if the configuration fails.
parent
af42d2a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
config/setup/root_test.go
config/setup/root_test.go
+4
-4
No files found.
config/setup/root_test.go
View file @
e66aa25f
...
...
@@ -13,18 +13,18 @@ func TestRoot(t *testing.T) {
// Predefined error substrings
parseErrContent
:=
"Parse error:"
unableToAccessErr
o
Content
:=
"Unable to access root path"
unableToAccessErrContent
:=
"Unable to access root path"
existingDirPath
,
err
:=
getTempDirPath
()
if
err
!=
nil
{
t
.
Error
f
(
"BeforeTest: Failed to find an existing directory for testing! Error was: %v"
,
err
)
t
.
Fatal
f
(
"BeforeTest: Failed to find an existing directory for testing! Error was: %v"
,
err
)
}
nonExistingDir
:=
filepath
.
Join
(
existingDirPath
,
"highly_unlikely_to_exist_dir"
)
existingFile
,
err
:=
ioutil
.
TempFile
(
""
,
"root_test"
)
if
err
!=
nil
{
t
.
Error
f
(
"BeforeTest: Failed to create temp file for testing! Error was: %v"
,
err
)
t
.
Fatal
f
(
"BeforeTest: Failed to create temp file for testing! Error was: %v"
,
err
)
}
defer
os
.
Remove
(
existingFile
.
Name
())
...
...
@@ -48,7 +48,7 @@ func TestRoot(t *testing.T) {
`root `
,
true
,
""
,
parseErrContent
,
},
{
fmt
.
Sprintf
(
`root %s`
,
unaccessiblePath
),
true
,
""
,
unableToAccessErr
o
Content
,
fmt
.
Sprintf
(
`root %s`
,
unaccessiblePath
),
true
,
""
,
unableToAccessErrContent
,
},
{
fmt
.
Sprintf
(
`root {
...
...
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