Based on the largest homogeneously reduced set of Type Ia supernova luminosity data currently available – the Union2 sample – we reconstruct the expansion history of the Universe in a model-independent approach. Our method tests the geometry of the Universe directly without reverting to any assumptions made on its energy content and thus allows us to constrain dark energy models in a straightforward way. This is demonstrated by confronting the expansion history reconstructed from the supernova data to predictions of several dark energy models in the framework of the w cold dark matter (wCDM) paradigm. In addition, we test various non-standard cosmologies such as braneworlds, f(R) and kinematical models. This is mainly intended to demonstrate the power of the method. Although statistical rigour is not the aim of our current study, some extreme cosmologies clearly disagree with the reconstructed expansion history. We note that the applicability of the presented method is not restricted to testing cosmological models. It can be a valuable tool for pointing out systematic errors hidden in the supernova data and planning future Type Ia supernova cosmology campaigns.