Permalink
Browse files

Only parse_arguments one time in YardocTask

Closes #559
  • Loading branch information...
1 parent bc27497 commit 02db880c03dfec154e8a6bd5d6b5ecc987d62cc7 @lsegal committed Jul 14, 2012
Showing with 10 additions and 2 deletions.
  1. +1 −2 lib/yard/rake/yardoc_task.rb
  2. +9 −0 spec/rake/yardoc_task_spec.rb
@@ -64,9 +64,8 @@ def define
task(name) do
before.call if before.is_a?(Proc)
yardoc = YARD::CLI::Yardoc.new
- yardoc.parse_arguments *(options + files)
yardoc.options[:verifier] = verifier if verifier
- yardoc.run
+ yardoc.run *(options + files)
after.call if after.is_a?(Proc)
end
end
@@ -45,6 +45,15 @@ def run
run
@yardoc.visibilities.should == [:public, :private, :protected]
end
+
+ it "should allow --api and --no-api" do
+ YARD::Rake::YardocTask.new do |t|
+ t.options = %w(--api public --no-api)
+ end
+ run
+ @yardoc.options.verifier.expressions.
+ should include('["public"].include?(@api.text) || !@api')
+ end
end
describe '#before' do

0 comments on commit 02db880

Please sign in to comment.