func (s *LoginSuite) TestWritesCurrentSystem(c *gc.C) { _, err := s.runServerFile(c) c.Assert(err, jc.ErrorIsNil) currentSystem, err := envcmd.ReadCurrentSystem() c.Assert(err, jc.ErrorIsNil) c.Assert(currentSystem, gc.Equals, "foo") }
func (s *SwitchSimpleSuite) TestSettingWritesSystemFile(c *gc.C) { s.addTestSystem(c) context, err := testing.RunCommand(c, &SwitchCommand{}, "a-system") c.Assert(err, jc.ErrorIsNil) c.Assert(testing.Stderr(context), gc.Equals, "-> a-system (system)\n") currSystem, err := envcmd.ReadCurrentSystem() c.Assert(err, jc.ErrorIsNil) c.Assert(currSystem, gc.Equals, "a-system") }
func (s *filesSuite) assertCurrentSystem(c *gc.C, systemName string) { current, err := envcmd.ReadCurrentSystem() c.Assert(err, jc.ErrorIsNil) c.Assert(current, gc.Equals, systemName) }