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