/** * @param \AmazonS3 $service */ function it_is_verbose_and_throws_exceptions_when_read($service) { $service->if_bucket_exists('bucketName')->shouldBeCalled()->willReturn(true); $service->get_object('bucketName', 'filename', array())->willThrow(new \RuntimeException('read')); $service->set_region(Argument::any())->shouldBeCalled(); $this->shouldThrow(new \RuntimeException('read'))->duringRead('filename'); }
/** * @param \AmazonS3 $service */ function it_should_not_mask_exception_when_read($service) { $service->if_bucket_exists('bucketName')->shouldBeCalled()->willReturn(true); $service->get_object('bucketName', 'filename', array())->willThrow(new \RuntimeException('read')); $this->shouldThrow(new \RuntimeException('read'))->duringRead('filename'); }