Sha256: 719912ce03af00c1bcf8f3c9053bbcc401c072d0c6aab7042c856228670a44b1

Contents?: true

Size: 1.09 KB

Versions: 39

Compression:

Stored size: 1.09 KB

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe YARD::Server::Adapter do
  after(:all) { Server::Adapter.shutdown }

  describe '#add_library' do
    it "should add a library" do
      lib = LibraryVersion.new('yard')
      a = Adapter.new({})
      a.libraries.should be_empty
      a.add_library(lib)
      a.libraries['yard'].should == [lib]
    end
  end
  
  describe '#start' do
    it "should not implement #start" do
      lambda { Adapter.new({}).start }.should raise_error(NotImplementedError)
    end
  end
  
  describe '.setup' do
    it 'should add template paths and helpers' do
      Adapter.setup
      Templates::Template.extra_includes.should include(DocServerHelper)
      Templates::Engine.template_paths.should include(YARD::ROOT + '/yard/server/templates')
    end
  end
  
  describe '.shutdown' do
    it 'should cleanup template paths and helpers' do
      Adapter.setup
      Adapter.shutdown
      Templates::Template.extra_includes.should_not include(DocServerHelper)
      Templates::Engine.template_paths.should_not include(YARD::ROOT + '/yard/server/templates')
    end
  end
end

Version data entries

39 entries across 39 versions & 4 rubygems

Version Path
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.3.0 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.2.1 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
challah-0.2.0 vendor/bundle/gems/yard-0.7.5/spec/server/adapter_spec.rb
yard-0.7.5 spec/server/adapter_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/yard-0.7.4/spec/server/adapter_spec.rb