Skip to content

Commit

Permalink
refactor SSP loading for document_test
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Aug 28, 2016
1 parent e5a5c46 commit af067bd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions ssp/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ import (
. "github.com/onsi/gomega"
)

func loadSSP(name string) *Document {
path := filepath.Join("..", "fixtures", name)
doc, err := Load(path)
Expect(err).NotTo(HaveOccurred())
return doc
}

var _ = Describe("SSP", func() {
Describe("Load", func() {
It("gets the content from the doc", func() {
path := filepath.Join("..", "fixtures", "FedRAMP_ac-2-1_v2.1.docx")
s, err := Load(path)
Expect(err).NotTo(HaveOccurred())
defer s.Close()
doc := loadSSP("FedRAMP_ac-2-1_v2.1.docx")
defer doc.Close()

Expect(s.Content()).To(ContainSubstring("Control Enhancement"))
Expect(doc.Content()).To(ContainSubstring("Control Enhancement"))
})

It("give an error when the doc isn't found", func() {
Expand Down

0 comments on commit af067bd

Please sign in to comment.