Yoda's name and his presence in the film as a force-user (involved in Luke's training) were both "spoiled" in advance of the film's release.
Original Theatrical Trailer
This (japanese) album insert was released in April 1980, approximately one month before the film hit cinema screens and shows Yoda's name. It's one of a variety of examples found in the Star Wars Scrapbook which includes a great deal of pre-release material from both 'The Empire Strikes Back' and 'Revenge of the Jedi'
You may also wish to note that the paperback release of the film's official novelisation was 13 days before the film received a general release so it's perfectly possible to have read the book before seeing the film.