The Spanish general election was expected to be a bellwether for the political direction of the European Union as a whole.