deps = command_registry.Dependency{ Ui: ui, Config: configRepo, RepoLocator: repoLocator, } cmd = &user.UnsetOrgRole{} cmd.SetDependency(deps, false) flagContext = flags.NewFlagContext(map[string]flags.FlagSet{}) factory = &fakerequirements.FakeFactory{} loginRequirement = &passingRequirement{} factory.NewLoginRequirementReturns(loginRequirement) userRequirement = &fakerequirements.FakeUserRequirement{} userRequirement.ExecuteReturns(true) factory.NewUserRequirementReturns(userRequirement) organizationRequirement = &fakerequirements.FakeOrganizationRequirement{} organizationRequirement.ExecuteReturns(true) factory.NewOrganizationRequirementReturns(organizationRequirement) }) Describe("Requirements", func() { Context("when not provided exactly three args", func() { BeforeEach(func() { flagContext.Parse("the-user-name", "the-org-name") })