Is there a nicer way of setting up these tests?