Sha256: 66ed2289803ccd418d94a774cca9ed4afb235340c0a235042c428ac8ce6f386b

Contents?: true

Size: 869 Bytes

Versions: 56

Compression:

Stored size: 869 Bytes

Contents

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

describe YARD::CodeObjects::CodeObjectList do
  before { Registry.clear }
  
  it "pushing a value should only allow CodeObjects::Base, String or Symbol" do
    list = CodeObjectList.new(nil)
    lambda { list.push(:hash => 1) }.should raise_error(ArgumentError)
    list << "Test"
    list << :Test2
    list << ModuleObject.new(nil, :YARD)
    list.size.should == 3
  end
  
  it "added value should be a proxy if parameter was String or Symbol" do
    list = CodeObjectList.new(nil)
    list << "Test"
    list.first.class.should == Proxy
  end
  
  it "should contain a unique list of objects" do
    obj = ModuleObject.new(nil, :YARD)
    list = CodeObjectList.new(nil)
    
    list << P(:YARD)
    list << obj
    list.size.should == 1
    
    list << :Test
    list << "Test"
    list.size.should == 2
  end
end

Version data entries

56 entries across 56 versions & 4 rubygems

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