Sha256: 8d69958fc94f290d0ca2c7879ae8bbb836510a45e0b79738cfb7b116b3c60ee8

Contents?: true

Size: 1.03 KB

Versions: 21

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true
require 'ostruct'

RSpec.describe YARD::Server::Commands::LibraryCommand do
  before do
    allow(Templates::Engine).to receive(:render)
    allow(Templates::Engine).to receive(:generate)
    allow(YARD).to receive(:parse)
    allow(Registry).to receive(:load)
    allow(Registry).to receive(:save)

    @cmd = LibraryCommand.new(:adapter => mock_adapter)
    @request = mock_request("/foo", :xhr? => false)
    @library = OpenStruct.new(:source_path => '.')
    @cmd.library = @library
    allow(@cmd).to receive(:load_yardoc).and_return(nil)
  end

  def call
    expect { @cmd.call(@request) }.to raise_error(NotImplementedError)
  end

  describe "#call" do
    it "raises NotImplementedError" do
      call
    end

    it "sets :rdoc as the default markup in incremental mode" do
      @cmd.incremental = true
      call
      expect(@cmd.options[:markup]).to eq :rdoc
    end

    it "sets :rdoc as the default markup in regular mode" do
      call
      expect(@cmd.options[:markup]).to eq :rdoc
    end
  end
end

Version data entries

21 entries across 20 versions & 4 rubygems

Version Path
yard-0.9.24 spec/server/commands/library_command_spec.rb
yard-0.9.23 spec/server/commands/library_command_spec.rb
yard-0.9.22 spec/server/commands/library_command_spec.rb
yard-0.9.21 spec/server/commands/library_command_spec.rb
yard-0.9.20 spec/server/commands/library_command_spec.rb
yard-0.9.19 spec/server/commands/library_command_spec.rb
yard-0.9.16 spec/server/commands/library_command_spec.rb
yard-0.9.15 spec/server/commands/library_command_spec.rb
yard-0.9.14 spec/server/commands/library_command_spec.rb
yard-0.9.13 spec/server/commands/library_command_spec.rb
yard-0.9.12 spec/server/commands/library_command_spec.rb
yard-0.9.11 spec/server/commands/library_command_spec.rb
yard-0.9.10 spec/server/commands/library_command_spec.rb
yard-0.9.9 spec/server/commands/library_command_spec.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.4.0/gems/yard-0.9.8/spec/server/commands/library_command_spec.rb
etude_for_ruby-0.1.4 vendor/bundle/ruby/2.2.0/gems/yard-0.9.8/spec/server/commands/library_command_spec.rb
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/yard-0.9.8/spec/server/commands/library_command_spec.rb
yard-0.9.8 spec/server/commands/library_command_spec.rb
abaci-0.3.0 vendor/bundle/gems/yard-0.9.7/spec/server/commands/library_command_spec.rb
yard-0.9.7 spec/server/commands/library_command_spec.rb