Kuhaka Jātaka (No.89)
Once a country squire, having great faith in the holiness of a matted-haired ascetic, buried some of his wealth in the hermitage he himself had provided for the ascetic. The latter, coveting the gold, hid it elsewhere, and took leave of the squire as though he were going to some other part of the country. The squire, after pressing him in vain to stay, accompanied him part of the way. Suddenly the ascetic stopped and said he had found a straw from the roof of the hermitage sticking to his hair and wished to restore it as it did not belong to him. The squire was greatly impressed by this show of non-covetousness, but another ascetic, who was the Bodhisatta, observing what happened and guessing the reason, communicated his suspicions to the squire. When they searched for the gold it could not be found, but the ascetic confessed his guilt after a sound thrashing (J.i.375 ﬀ).
The occasion for the telling of the story is given in the Uddālaka Jātaka.