From 1204390f81d148b760c4563835335ffdbb40db31 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Tue, 12 Nov 2013 14:23:06 +0100 Subject: [PATCH] Make Docs::Scraper.root_path inheritable --- lib/docs/core/scraper.rb | 1 + test/lib/docs/core/scraper_test.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/docs/core/scraper.rb b/lib/docs/core/scraper.rb index 47010b56..37b6e43d 100644 --- a/lib/docs/core/scraper.rb +++ b/lib/docs/core/scraper.rb @@ -14,6 +14,7 @@ module Docs autoload_all "docs/filters/#{to_s.demodulize.underscore}", 'filter' end + subclass.root_path = root_path subclass.options = options.deep_dup subclass.html_filters = html_filters.inheritable_copy subclass.text_filters = text_filters.inheritable_copy diff --git a/test/lib/docs/core/scraper_test.rb b/test/lib/docs/core/scraper_test.rb index 1610c623..7d431b45 100644 --- a/test/lib/docs/core/scraper_test.rb +++ b/test/lib/docs/core/scraper_test.rb @@ -33,6 +33,10 @@ class DocsScraperTest < MiniTest::Spec assert_equal Scraper.type, subclass.type end + it "sets .root_path" do + assert_equal Scraper.root_path, subclass.root_path + end + it "duplicates .options" do stub(Scraper).options { { test: [] } } assert_equal Scraper.options, subclass.options