“Don’t let the cat out of the bag.” is said to refer to the time of the tall ships, they kept the cat of nine tails in a bag and it was only taken out when someone on board was to be flogged.
In the middle ages salesmen would sell pigs in a poke sack to farmers. Often the farmer found he had bought a dog or cat.
So, Don’t Buy A Pig In A Poke!