htmlspec

package module
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2018 License: BSD-3-Clause Imports: 6 Imported by: 1

README

htmlspec

Build status GoDoc Go Report Card Coverage Status

HTML output generator for the BDD framework GoGiven

Import:

import github.com/corbym/htmlspec

Usage:

package foo
import (
	"testing"
	"github.com/corbym/gogiven"
	"github.com/corbym/htmlspec"
	"os"
)

func TestMain(testmain *testing.M) {
	gogiven.Generator = htmlspec.NewTestOutputGenerator()
	runOutput := testmain.Run()
	gogiven.GenerateTestOutput()
	os.Exit(runOutput)
}

... actual tests...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestOutputGenerator

type TestOutputGenerator struct {
	generator.GoGivensOutputGenerator
	// contains filtered or unexported fields
}

TestOutputGenerator is an implementation of the GoGivensOutputGenerator that generates an html file per test. It is thread safe between goroutines.

func NewTestOutputGenerator

func NewTestOutputGenerator() *TestOutputGenerator

NewTestOutputGenerator creates a template that is used to generate the html output.

func (*TestOutputGenerator) ContentType added in v1.4.0

func (outputGenerator *TestOutputGenerator) ContentType() string

ContentType for the output generated.

func (*TestOutputGenerator) Generate

func (outputGenerator *TestOutputGenerator) Generate(pageData generator.PageData) io.Reader

Generate generates html output for a test. The return string contains the html that goes into the output file generated in gogivens.GenerateTestOutput(). The function panics if the template cannot be generated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL