Sha256: 3e36f804c98dda675d59745a98f47f7130d8e75d8723cb2f6ecff5301c4317a3

Contents?: true

Size: 1.37 KB

Versions: 39

Compression:

Stored size: 1.37 KB

Contents

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

describe YARD::Templates::Engine.template(:default, :constant) do
  describe 'fully dressed constant' do
    it "should render text format correctly" do
      YARD.parse_string <<-'eof'
        class YARD::CLI::YRI
          # Default search paths that should be loaded dynamically into YRI. These paths
          # take precedence over all other paths ({SEARCH_PATHS_FILE} and RubyGems
          # paths). To add a path, call: 
          # 
          #   DEFAULT_SEARCH_PATHS.push("/path/to/.yardoc")
          # 
          # @return [Array<String>] a list of extra search paths
          # @since 0.6.0
          DEFAULT_SEARCH_PATHS = []
        end
      eof
      text_equals(Registry.at('YARD::CLI::YRI::DEFAULT_SEARCH_PATHS').format, :constant001)
    end
  end
  
  describe 'simple constant with no documentation' do
    it "should render text format correctly" do
      # Short constant should show on single line
      YARD.parse_string <<-'eof'
        MYCONST = 'foo'
      eof
      text_equals(Registry.at('MYCONST').format, :constant002)

      # Long constant should show on multiple lines, indented
      YARD.parse_string <<-'eof'
        MYCONST = [A, B, C, D, E, F, G, H, I, J, K, L,
          M, N, O, P, Q, R, S, T, U, V, W,
          X, Y, Z]
      eof
      text_equals(Registry.at('MYCONST').format, :constant003)
    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/templates/constant_spec.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.5.3 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.5.2 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.5.1 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.5.0 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.4.1 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.4.0 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.3.5 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.3.4 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.3.3 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.3.2 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.3.1 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.3.0 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.2.1 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
challah-0.2.0 vendor/bundle/gems/yard-0.7.5/spec/templates/constant_spec.rb
yard-0.7.5 spec/templates/constant_spec.rb
nutshell-crm-0.0.6.alpha vendor/bundle/gems/yard-0.7.4/spec/templates/constant_spec.rb