Skip to content

Commit

Permalink
fix narrative tests
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Aug 28, 2016
1 parent 67b5780 commit 8556567
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
21 changes: 3 additions & 18 deletions opencontrols/data_test.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,22 @@
package opencontrols_test

import (
"path/filepath"

. "github.com/opencontrol/fedramp-templater/opencontrols"
"github.com/opencontrol/fedramp-templater/fixtures"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

// TODO share with templater_test
func loadOpenControlFixture() Data {
openControlDir := filepath.Join("..", "fixtures", "opencontrols")
openControlDir, err := filepath.Abs(openControlDir)
Expect(err).NotTo(HaveOccurred())
openControlData, errors := LoadFrom(openControlDir)
for _, err := range errors {
Expect(err).NotTo(HaveOccurred())
}

return openControlData
}

var _ = Describe("Data", func() {
Describe("GetNarrative", func() {
It("returns the relevant singular narrative", func() {
data := loadOpenControlFixture()
data := fixtures.LoadOpenControlFixture()
result := data.GetNarrative("AC-2 (1)", "")
Expect(result).To(Equal("Amazon Elastic Compute Cloud\nJustification in narrative form for AC-2 (1)\n"))
})

It("returns the relevant narrative section", func() {
data := loadOpenControlFixture()
data := fixtures.LoadOpenControlFixture()
result := data.GetNarrative("AC-2", "a")
Expect(result).To(Equal("Amazon Elastic Compute Cloud\nJustification in narrative form A for AC-2\n"))
})
Expand Down
2 changes: 1 addition & 1 deletion ssp/document_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var _ = Describe("SSP", func() {

Describe("NarrativeTables", func() {
It("returns the tables", func() {
doc := loadSSP("FedRAMP_ac-2_v2.1.docx")
doc := fixtures.LoadSSP("FedRAMP_ac-2_v2.1.docx")
defer doc.Close()

tables, err := doc.NarrativeTables()
Expand Down

0 comments on commit 8556567

Please sign in to comment.