1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Rename checklisttests to checklist_tests

This commit is contained in:
Chris Cummer
2018-08-19 14:40:38 -07:00
parent 099fa58b39
commit def1869f8d

View File

@@ -0,0 +1,43 @@
package wtftests
import (
"testing"
"github.com/olebedev/config"
. "github.com/senorprogrammer/wtf/checklist"
"github.com/senorprogrammer/wtf/wtf"
. "github.com/stretchr/testify/assert"
)
/* -------------------- CheckMark -------------------- */
func TestCheckMark(t *testing.T) {
loadConfig()
item := ChecklistItem{}
Equal(t, " ", item.CheckMark())
item = ChecklistItem{Checked: true}
Equal(t, "x", item.CheckMark())
}
/* -------------------- Toggle -------------------- */
func TestToggle(t *testing.T) {
loadConfig()
item := ChecklistItem{}
Equal(t, false, item.Checked)
item.Toggle()
Equal(t, true, item.Checked)
item.Toggle()
Equal(t, false, item.Checked)
}
/* -------------------- helpers -------------------- */
func loadConfig() {
wtf.Config, _ = config.ParseYamlFile("../_sample_configs/simple_config.yml")
}