This question already has an answer here:
Playing through Portal, I like most other people found several of the hidden rooms where Doug Rattman wrote all sorts of things, including that the promised cake is a lie.
I realized that GLaDOS was just using the cake as false motivation. But then I beat the game and watched as the ending credits rolled, and in the very last scene, we see a cake, surrounded by personality cores and a companion cube!
Does this mean that the cake was not a lie?