When Moshe sent the twelve spies into the land to explore its strengths and weaknesses, ten came back with an evil report and Joshua and Calev declared that “the land is very very good”.
It is clear that Joshua had the strength to avoid the pitfall of the other spies because he received a special blessing when his name was changed from Hoshea to Yehoshuah ( Rashi, Sotah 34b) Yet Calev also did not fall prey to the disheartened spirit that felled the other ten spies. In fact we hear of Calev,”But as for My servant Caleb, since he was possessed by another spirit, and he followed Me, I will bring him to the land to which he came, and his descendants will drive it[s inhabitants] out.( Bamidbar /Numbers 14:24)