func (*HousingSuite) TestReplacesFilter(c *gc.C) { expectIn := errors.New("tweedledum") expectOut := errors.New("tweedledee") manifold := util.Housing{ Filter: func(in error) error { c.Check(in, gc.Equals, expectIn) return expectOut }, }.Decorate(dependency.Manifold{ Filter: panicFilter, }) out := manifold.Filter(expectIn) c.Check(out, gc.Equals, expectOut) }
func (*HousingSuite) TestEmptyHousingPopulatedManifold(c *gc.C) { manifold := util.Housing{}.Decorate(dependency.Manifold{ Inputs: []string{"x", "y", "z"}, Start: panicStart, Output: panicOutput, Filter: panicFilter, }) c.Check(manifold.Inputs, jc.DeepEquals, []string{"x", "y", "z"}) c.Check(func() { manifold.Start(nil) }, gc.PanicMatches, "panicStart") c.Check(func() { manifold.Output(nil, nil) }, gc.PanicMatches, "panicOutput") c.Check(func() { manifold.Filter(nil) }, gc.PanicMatches, "panicFilter") }