func (s *FileVarSuite) TestReadStdin(c *gc.C) { s.ctx.Stdin = bytes.NewBufferString("abc") var config cmd.FileVar config.SetStdin() config.Set("-") file, err := config.Read(s.ctx) c.Assert(err, gc.IsNil) c.Assert(string(file), gc.Equals, "abc") }
func (s *FileVarSuite) TestOpenStdin(c *gc.C) { s.ctx.Stdin = bytes.NewBufferString("abc") var config cmd.FileVar config.SetStdin() config.Set("-") file, err := config.Open(s.ctx) c.Assert(err, gc.IsNil) s.checkOpen(c, file, "abc") }
func (s *FileVarSuite) TestSetStdin(c *gc.C) { var config cmd.FileVar c.Assert(config.Path, gc.Equals, "") c.Assert(config.StdinMarkers, jc.DeepEquals, []string{}) config.SetStdin() c.Assert(config.Path, gc.Equals, "") c.Assert(config.StdinMarkers, jc.DeepEquals, []string{"-"}) config.SetStdin("<>", "@") c.Assert(config.Path, gc.Equals, "") c.Assert(config.StdinMarkers, jc.DeepEquals, []string{"<>", "@"}) }