diff options
author | Reinhard Tartler <siretart@tauware.de> | 2020-12-02 09:24:47 -0500 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2020-12-02 09:24:58 -0500 |
commit | 29cc1453eab24cbbfcdd21b9b86a36ff3183a840 (patch) | |
tree | 6a8ea32fea737936384e95e2ba2109dfc373697c /vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go | |
parent | 8086b728c2d5c06e05010693cdbe64e972a31128 (diff) |
delete vendor tree
Diffstat (limited to 'vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go')
-rw-r--r-- | vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go b/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go deleted file mode 100644 index ec6506b..0000000 --- a/vendor/github.com/onsi/gomega/matchers/be_an_existing_file.go +++ /dev/null @@ -1,40 +0,0 @@ -// untested sections: 3 - -package matchers - -import ( - "fmt" - "os" - - "github.com/onsi/gomega/format" -) - -type BeAnExistingFileMatcher struct { - expected interface{} -} - -func (matcher *BeAnExistingFileMatcher) Match(actual interface{}) (success bool, err error) { - actualFilename, ok := actual.(string) - if !ok { - return false, fmt.Errorf("BeAnExistingFileMatcher matcher expects a file path") - } - - if _, err = os.Stat(actualFilename); err != nil { - switch { - case os.IsNotExist(err): - return false, nil - default: - return false, err - } - } - - return true, nil -} - -func (matcher *BeAnExistingFileMatcher) FailureMessage(actual interface{}) (message string) { - return format.Message(actual, fmt.Sprintf("to exist")) -} - -func (matcher *BeAnExistingFileMatcher) NegatedFailureMessage(actual interface{}) (message string) { - return format.Message(actual, fmt.Sprintf("not to exist")) -} |