Sha256: f8ee8080d0f3aed5f99c62db8d3734d948e99bc9399e6871260aa086ad0d8495

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 KB

Contents

require File.join(File.dirname(__FILE__), '/spec_helper')

describe RDoc::Generator::SDoc do
  before :each do
    @options = RDoc::Options.new
    @options.setup_generator 'sdoc'
    @parser = @options.option_parser
  end

  it "should find sdoc generator" do
    RDoc::RDoc::GENERATORS.must_include 'sdoc'
  end

  it "should use sdoc generator" do
    @options.generator.must_equal RDoc::Generator::SDoc
    @options.generator_name.must_equal 'sdoc'
  end

  it "should parse github option" do
    assert !@options.github

    out, err = capture_io do
      @parser.parse %w[--github]
    end

    err.wont_match /^invalid options/
    @options.github.must_equal true
  end

  it "should parse github short-hand option" do
    assert !@options.github

    out, err = capture_io do
      @parser.parse %w[-g]
    end

    err.wont_match /^invalid options/
    @options.github.must_equal true
  end

  it "should parse no search engine index option" do
    @options.search_index.must_equal true

    out, err = capture_io do
      @parser.parse %w[--without-search]
    end

    err.wont_match /^invalid options/
    @options.search_index.must_equal false
  end

  it "should parse search-index shorthand option" do
    @options.search_index.must_equal true
    out, err = capture_io do
      @parser.parse %w[-s]
    end

    err.wont_match /^invalid options/
    @options.search_index.must_equal false
  end

end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/sdoc-0.4.1/spec/rdoc_generator_spec.rb
sdoc-0.4.1 spec/rdoc_generator_spec.rb
sdoc-0.4.0 spec/rdoc_generator_spec.rb
sdoc-0.4.0.rc.1 spec/rdoc_generator_spec.rb