From 0eac7ab1be2287f215a4f9e2653d10d36c584291 Mon Sep 17 00:00:00 2001 From: Jesse Nelson Date: Thu, 29 May 2014 01:12:43 -0700 Subject: [PATCH] add cookbook test(s) --- cookbook_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cookbook_test.go diff --git a/cookbook_test.go b/cookbook_test.go new file mode 100644 index 0000000..6683ecc --- /dev/null +++ b/cookbook_test.go @@ -0,0 +1,20 @@ +package chef + +import ( + . "github.com/smartystreets/goconvey/convey" + "testing" +) + +func TestNewCookbook(t *testing.T) { + Convey("Create a cookbook", t, func() { + cook, err := NewCookbook(&Reader{"name": "blah"}) + So(cook.Name, ShouldEqual, "blah") + So(err, ShouldBeNil) + }) + Convey("Cookbook Decoder fail", t, func() { + failCook, err := NewCookbook(&Reader{"name": struct{}{}}) + So(err, ShouldNotBeNil) + So(failCook, ShouldBeNil) + }) + +}