// Tests that Resources outside of the main 'resource' package work
// correctly and that non-pointer Resources work
Tests that Resources outside of the main 'resource' package work
correctly and that non-pointer Resources work
// Tests that Resources outside of the main ' resource ' package work // correctly and that non - pointer Resources work
func TestPlanToJSON(t *testing.T) {
	b := NewBuilder()
	b.AddResource("test:foo", &testResource{ID: "test:foo"})
	b.AddResource("test:bar", &testResource{ID: "test:bar"}, DependOn("test:foo"))
	b.AddResource("test:baz", &testResource{ID: "test:baz"}, DependOn("test:bar"))
	b.AddResource("test:quux", &testResource{ID: "test:quux"}, DependOn("test:baz"))
	b.AddResource("npr:erf", nonPointerResource{"npr:erf"}, DependOn("test:foo", "test:bar"))
	pin, err := b.Plan()
	assert.NoError(t, err)
	pout, err := NewPlanFromJSON(strings.NewReader(pin.ToJSON()))
	assert.NoError(t, err)
	assert.True(t, EqualPlans(pin, pout))
}
func TestPlanToJSON ( t * testing . T ) { b := NewBuilder ( ) b . AddResource ( " " , & testResource { ID : " " } ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) b . AddResource ( " " , & testResource { ID : " " } , DependOn ( " " ) ) b . AddResource ( " " , nonPointerResource { " " } , DependOn ( " " , " " ) ) pin , err := b . Plan ( ) assert . NoError ( t , err ) pout , err := NewPlanFromJSON ( strings . NewReader ( pin . ToJSON ( ) ) ) assert . NoError ( t , err ) assert . True ( t , EqualPlans ( pin , pout ) ) }
Tests that Resources outside of the main 'resource' package work
correctly and that non-pointer Resources work
Tests that Resources outside of the main ' resource ' package work correctly and that non - pointer Resources work