History

Make Docs::Scraper.root_path inheritable

Thibaut committed 13 years ago

Commit 12043901 parent aed8f222 files · +5 −0Browse files

Unified · Split

2 files
  1. lib/docs/core/scraper.rb +1 −0
  2. test/lib/docs/core/scraper_test.rb +4 −0
lib/docs/core/scraper.rb+1−0
@@ -14,6 +14,7 @@ module Docs · 13 unmodified lines
14 autoload_all "docs/filters/#{to_s.demodulize.underscore}", 'filter'14 autoload_all "docs/filters/#{to_s.demodulize.underscore}", 'filter'
15 end15 end
16 16
17 subclass.root_path = root_path
17 subclass.options = options.deep_dup18 subclass.options = options.deep_dup
18 subclass.html_filters = html_filters.inheritable_copy19 subclass.html_filters = html_filters.inheritable_copy
19 subclass.text_filters = text_filters.inheritable_copy20 subclass.text_filters = text_filters.inheritable_copy
test/lib/docs/core/scraper_test.rb+4−0
@@ -33,6 +33,10 @@ class DocsScraperTest < MiniTest::Spec · 32 unmodified lines
33 assert_equal Scraper.type, subclass.type33 assert_equal Scraper.type, subclass.type
34 end34 end
35 35
36 it "sets .root_path" do
37 assert_equal Scraper.root_path, subclass.root_path
38 end
39
36 it "duplicates .options" do40 it "duplicates .options" do
37 stub(Scraper).options { { test: [] } }41 stub(Scraper).options { { test: [] } }
38 assert_equal Scraper.options, subclass.options42 assert_equal Scraper.options, subclass.options