From 1325f34b49703bd26825eae33ccfaa01e8d99105 Mon Sep 17 00:00:00 2001 From: Rob Pocklington Date: Fri, 27 May 2016 18:20:51 +1000 Subject: [PATCH] Updated slate_writer_spec.rb to verify correct file created. --- spec/writers/slate_writer_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/spec/writers/slate_writer_spec.rb b/spec/writers/slate_writer_spec.rb index 9e6e33b0..3f121b52 100644 --- a/spec/writers/slate_writer_spec.rb +++ b/spec/writers/slate_writer_spec.rb @@ -15,6 +15,23 @@ end end + describe "#write" do + let(:writer) { described_class.new(index, configuration) } + + before do + template_dir = File.join(configuration.template_path, "rspec_api_documentation") + FileUtils.mkdir_p(template_dir) + File.open(File.join(template_dir, "markdown_index.mustache"), "w+") { |f| f << "{{ mustache }}" } + FileUtils.mkdir_p(configuration.docs_dir) + end + + it "should write the index" do + writer.write + index_file = File.join(configuration.docs_dir, "index.html.md") + expect(File.exists?(index_file)).to be_truthy + end + end + context 'instance methods' do let(:writer) { described_class.new(index, configuration) }