When Noah released a bird to test whether the floodwaters had receded, the Torah tells us he sent out a raven (Genesis 8:7). The midrash on this verse imagines an argument breaking out in the ark itself. The raven refused.
Of all the cattle, beasts, and fowl on this vessel, the raven complained, you send only me? Why must I be the first one to risk the storm? Noah, exhausted and fed up, shot back, What use is the world for you anyway? You are not fit for food, and you are not fit for the altar as a sacrifice. Go.
Rabbi Eliezer then steps into the midrash with a surprising counter-teaching. The raven, he says, had actually been accepted onto the ark by divine command. Take the raven in, God had told Noah, because the world will one day have need of him. When? Noah had asked. Not now, said the Holy One. Not when the waters are drying. But in a time to come there will arise a certain righteous man who will dry up the world with his word, and then I will need the raven.
That righteous man was Elijah the prophet, who would one day stand before King Ahab and swear that no rain would fall on Israel except by his word (1 Kings 17:1). And when Elijah hid at the brook Cherith, who fed him? And the ravens brought him bread and flesh in the morning, and bread and flesh in the evening (1 Kings 17:6). This passage from Pirkei deRabbi Eliezer, chapter 23, preserved in Harris's 1901 Hebraic Literature, teaches that every creature on the ark had a future in mind. The bird Noah almost sent away ungrateful was the same bird God was saving for His prophet, seven centuries later.