def it_can_add_a_heading(self, add_heading_fixture, add_paragraph_, paragraph_):
        level, style = add_heading_fixture
        add_paragraph_.return_value = paragraph_
        document = Document(None, None)

        paragraph = document.add_heading("Spam vs. Bacon", level)

        add_paragraph_.assert_called_once_with(document, "Spam vs. Bacon", style)
        assert paragraph is paragraph_
 def it_raises_on_heading_level_out_of_range(self):
     document = Document(None, None)
     with pytest.raises(ValueError):
         document.add_heading(level=-1)
     with pytest.raises(ValueError):
         document.add_heading(level=10)