From e720f56ea8f01d17baa600e0f212cee8ba7cc53c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 15 Jun 2015 22:45:31 +0900 Subject: [PATCH] Fix test code for docker build --- src/history_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/history_test.go b/src/history_test.go index 83e4029..fa6f106 100644 --- a/src/history_test.go +++ b/src/history_test.go @@ -1,6 +1,7 @@ package fzf import ( + "os/user" "testing" ) @@ -8,7 +9,12 @@ func TestHistory(t *testing.T) { maxHistory := 50 // Invalid arguments - for _, path := range []string{"/etc", "/proc", "/etc/sudoers"} { + user, _ := user.Current() + paths := []string{"/etc", "/proc"} + if user.Name != "root" { + paths = append(paths, "/etc/sudoers") + } + for _, path := range paths { if _, e := NewHistory(path, maxHistory); e == nil { t.Error("Error expected for: " + path) }