-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from jaypipes/issue12
allow override chroot with New()
- Loading branch information
Showing
5 changed files
with
147 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Use and distribution licensed under the Apache license version 2. | ||
// | ||
// See the COPYING file in the root project directory for full text. | ||
// | ||
|
||
package pcidb | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestMergeOptions(t *testing.T) { | ||
// Verify the default values are set if no overrides are passed | ||
opts := mergeOptions() | ||
if opts.Chroot == nil { | ||
t.Fatalf("Expected opts.Chroot to be non-nil.") | ||
} | ||
if opts.CacheOnly == nil { | ||
t.Fatalf("Expected opts.CacheOnly to be non-nil.") | ||
} | ||
|
||
// Verify if we pass an override, that value is used not the default | ||
opts = mergeOptions(WithChroot("/override")) | ||
if opts.Chroot == nil { | ||
t.Fatalf("Expected opts.Chroot to be non-nil.") | ||
} else if *opts.Chroot != "/override" { | ||
t.Fatalf("Expected opts.Chroot to be /override.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters