Even the fruit of the cucumber plant has spines. Don’t fruit usually tempt critters to consume them, so that they distribute the seeds?

Closeup of the spines on a cucumber still on the vine.