Files
docker-machine/libmachine/log/history_recorder_test.go
Jean-Laurent de Morlhon 7281142868 Extract Recording Code
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-12-16 16:49:31 +01:00

22 lines
483 B
Go

package log
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestRecording(t *testing.T) {
recorder := NewHistoryRecorder()
recorder.Record("foo")
recorder.Record("bar")
recorder.Record("qix")
assert.Equal(t, recorder.History(), []string{"foo", "bar", "qix"})
}
func TestFormattedRecording(t *testing.T) {
recorder := NewHistoryRecorder()
recorder.Recordf("%s, %s and %s", "foo", "bar", "qix")
assert.Equal(t, recorder.History()[0], "foo, bar and qix")
}