require "spec" require "../src/markd" describe Markd::Options do describe "#base_url" do it "it disabled by default" do options = Markd::Options.new Markd.to_html("[foo](bar)", options).should eq %(

foo

\n) Markd.to_html("![](bar)", options).should eq %(

\n) end it "absolutizes relative urls" do options = Markd::Options.new options.base_url = URI.parse("http://example.com") Markd.to_html("[foo](bar)", options).should eq %(

foo

\n) Markd.to_html("[foo](https://example.com/baz)", options).should eq %(

foo

\n) Markd.to_html("![](bar)", options).should eq %(

\n) Markd.to_html("![](https://example.com/baz)", options).should eq %(

\n) end end end