Sha256: f52368c0f8c0d9af1f0f4964b7d3b02952c527a3edf55993696bec1f28e7b637

Contents?: true

Size: 1 KB

Versions: 1

Compression:

Stored size: 1 KB

Contents

require File.expand_path('../../spec_helper', __FILE__)

module PlaygroundBookLint
  describe RootManifestLinter do
    include FakeFS::SpecHelpers
    let(:chapter_linter) { ChapterLinter.new(chapter_manifest_linter) }
    let(:chapter_manifest_linter) { double(ChapterManifestLinter) }
    let!(:chapter_directory_name) { 'test_chapter' }

    it 'fails when chapter directory does not exist' do
      expect{ chapter_linter.lint(chapter_directory_name) }.to raise_error(SystemExit)
    end

    it 'fails when Pages subdirectory of chapter dir does not exist' do
      FakeFS do
        Dir.mkdir(chapter_directory_name)
        expect{ chapter_linter.lint(chapter_directory_name) }.to raise_error(SystemExit)
      end
    end

    it 'calls through to chapter manifest linter' do
      FakeFS do
       expect(chapter_manifest_linter).to receive(:lint)
        FileUtils.mkdir_p("#{chapter_directory_name}/Pages")

        expect{ chapter_linter.lint(chapter_directory_name) }.to_not raise_error
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
playground-book-lint-0.0.1 spec/playground_book_lint/chapter_linter_spec.rb