AtlasClient: atlasClient, AWSClient: awsClient, Log: cliLogger, VagrantBoxName: "some/vagrantbox", Region: "some-region", Template: "some-template-data", } classroomName = fmt.Sprintf("test-%d", rand.Intn(16)) prefixedName = "classroom-" + classroomName }) It("should create a new SSH keypair and upload the private key to S3", func() { awsClient.CreateKeyCall.Returns.PrivateKeyPEM = "some-pem-data" Expect(c.CreateClassroom(classroomName, 42)).To(Succeed()) Expect(awsClient.CreateKeyCall.Receives.KeyName).To(Equal(prefixedName)) Expect(awsClient.StoreObjectCall.Receives.Name).To(Equal("keys/" + prefixedName)) Expect(awsClient.StoreObjectCall.Receives.Bytes).To(Equal([]byte("some-pem-data"))) Expect(awsClient.StoreObjectCall.Receives.DownloadFileName).To(Equal("bosh101_ssh_key.pem")) Expect(awsClient.StoreObjectCall.Receives.ContentType).To(Equal("application/x-pem-file")) }) It("should get the latest AMI for the vagrant box", func() { Expect(c.CreateClassroom(classroomName, 42)).To(Succeed()) Expect(atlasClient.GetLatestAMIsCall.Receives.BoxName).To(Equal("some/vagrantbox")) }) It("should create a CloudFormation stack", func() { Expect(c.CreateClassroom(classroomName, 42)).To(Succeed())