Sha256: 3d9c61d7bec6d295fc9136f813acaa6a687f78ffcc60358ec71b221f3e3776a7
Contents?: true
Size: 1.1 KB
Versions: 8
Compression:
Stored size: 1.1 KB
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe YARD::Tags::Library do def tag(docstring) Docstring.new(docstring).tags.first end describe "#see_tag" do it "takes a URL" do expect(tag("@see http://example.com").name).to eq "http://example.com" end it "takes an object path" do expect(tag("@see String#reverse").name).to eq "String#reverse" end it "takes a description after the url/object" do tag = tag("@see http://example.com An Example Site") expect(tag.name).to eq "http://example.com" expect(tag.text).to eq "An Example Site" end end describe ".define_tag" do it "allows defining tags with '.' in the name (x.y.z defines method x_y_z)" do Tags::Library.define_tag("foo", 'x.y.z') Tags::Library.define_tag("foo2", 'x.y.zz', Tags::OverloadTag) expect(Tags::Library.instance.method(:x_y_z_tag)).not_to be nil expect(Tags::Library.instance.method(:x_y_zz_tag)).not_to be nil expect(tag('@x.y.z foo bar').text).to eq 'foo bar' expect(tag('@x.y.zz foo(bar)').signature).to eq 'foo(bar)' end end end
Version data entries
8 entries across 7 versions & 2 rubygems