* Copyright 2016-2017 Gary Kramlich <grim@reaperworld.com> * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. "github.com/aphistic/sweet" . "github.com/onsi/gomega" cYaml "bitbucket.org/rw_grim/convey/yaml" func (s *dockerSuite) TestTag(t sweet.T) { Destination: "destination", Expect(p1.Valid()).To(BeNil()) Destinations: cYaml.StringOrSlice{"dest1", "dest2", "dest3"}, Expect(p2.Valid()).To(BeNil()) func (s *dockerSuite) TestTagSourceRequired(t sweet.T) { Destination: "destination", Expect(tag.Valid()).To(MatchError(errNoSourceTag)) func (s *dockerSuite) TestTagDestinationRequired(t sweet.T) { Expect(p1.Valid()).To(MatchError(errNoDestinationTags)) Destinations: cYaml.StringOrSlice{}, Expect(p2.Valid()).To(MatchError(errNoDestinationTags)) func (s *dockerSuite) TestTagValidNormalizesDestinations(t sweet.T) { Destinations: cYaml.StringOrSlice{"dest2", "dest3"}, Expect(p.Destinations).To(Equal(cYaml.StringOrSlice{"dest1", "dest2", "dest3"}))