Update Mocha documentation (3.0.2)

pull/417/merge
Thibaut Courouble 9 years ago
parent af3354a247
commit 8ad00814a9

@ -6,28 +6,36 @@ module Docs
'hooks' => ['before()', 'after()', 'beforeEach()', 'afterEach()', 'suiteSetup()', 'suiteTeardown()', 'setup()', 'teardown()'], 'hooks' => ['before()', 'after()', 'beforeEach()', 'afterEach()', 'suiteSetup()', 'suiteTeardown()', 'setup()', 'teardown()'],
'exclusive-tests' => ['only()'], 'exclusive-tests' => ['only()'],
'inclusive-tests' => ['skip()'], 'inclusive-tests' => ['skip()'],
'usage' => ['mocha'], 'bdd' => ['describe()', 'context()', 'it()', 'specify()'],
'bdd-interface' => ['describe()', 'context()', 'it()'], 'tdd' => ['suite()', 'test()'],
'tdd-interface' => ['suite()', 'test()'], 'exports' => ['exports'],
'exports-interface' => ['exports'], 'qunit' => ['QUnit'],
'qunit-interface' => ['QUnit'], 'require' => ['require'],
'require-interface' => ['require'], 'browser-specific-methods' => ['mocha.allowUncaught()', 'mocha.setup()', 'mocha.run()', 'mocha.globals()', 'mocha.checkLeaks()'],
'browser-setup' => ['setup()'], 'timeouts' => ['timeout()']
'mocha.opts' => ['mocha.opts'],
'suite-specific-timeouts' => ['timeout()']
} }
def additional_entries def additional_entries
ENTRIES.each_with_object [] do |(id, names), entries| entries = []
type = case id
when 'hooks' then 'Hooks'
when /interface/ then 'Interfaces'
else 'Miscellaneous' end
ENTRIES.each do |id, names|
names.each do |name| names.each do |name|
entries << [name, id, type] entries << [name, id] if at_css("[id='#{id}']")
end end
end end
css('h2').each do |node|
name = node.content.strip
next if name.in?(%w(Examples Getting\ Started Installation More\ Information Testing\ Mocha))
name = 'mocha' if name == 'Usage'
entries << [name, node['id']]
end
entries.each do |entry|
entry[2] = entry[0] =~ /\A[a-z]/ ? 'API' : 'Manual'
end
entries
end end
end end
end end

@ -1,14 +1,14 @@
module Docs module Docs
class Mocha < UrlScraper class Mocha < UrlScraper
self.type = 'mocha' self.type = 'mocha'
self.release = '2.5.3' self.release = '3.0.2'
self.base_url = 'https://mochajs.org/' self.base_url = 'https://mochajs.org/'
self.links = { self.links = {
home: 'https://mochajs.org/', home: 'https://mochajs.org/',
code: 'https://github.com/mochajs/mocha' code: 'https://github.com/mochajs/mocha'
} }
html_filters.push 'mocha/entries', 'mocha/clean_html', 'title' html_filters.push 'mocha/clean_html', 'mocha/entries', 'title'
options[:container] = '#content' options[:container] = '#content'
options[:title] = 'mocha' options[:title] = 'mocha'

Loading…
Cancel
Save