Sha256: 3fd2774d9a9a67755832bae787b11fd5d6af2b8d4f9eb58a4f33b3cfc94e5239
Contents?: true
Size: 1.79 KB
Versions: 1
Compression:
Stored size: 1.79 KB
Contents
require 'spec_helper' require 'ore/template/helpers/rdoc' describe Ore::Template::Helpers::RDoc do subject do Object.new.extend described_class end describe "#link_to" do let(:text) { "foo bar" } let(:url) { "https://example.com/foo/bar" } it "should return a link with the text and url" do expect(subject.link_to(text,url)).to be == %{{#{text}}[#{url}]} end end describe "#image" do let(:url) { "https://example.com/foo/bar.png" } context "with alt text" do let(:alt) { "foo bar" } it "should return a link with the alt text and url" do expect(subject.image(url,alt)).to be == "{#{alt}}[rdoc-image:#{url}]" end end context "without alt text" do it "should return a link with the alt text and url" do expect(subject.image(url)).to be == "{}[rdoc-image:#{url}]" end end end describe "#h1" do let(:title) { "Foo Bar" } it "should return a h1 header" do expect(subject.h1(title)).to be == "= #{title}" end end describe "#h2" do let(:title) { "Foo Bar" } it "should return a h2 header" do expect(subject.h2(title)).to be == "== #{title}" end end describe "#h3" do let(:title) { "Foo Bar" } it "should return a h3 header" do expect(subject.h3(title)).to be == "=== #{title}" end end describe "#h4" do let(:title) { "Foo Bar" } it "should return a h4 header" do expect(subject.h4(title)).to be == "==== #{title}" end end describe "#pre" do let(:lines) do [ %{puts "hello"}, %{}, %{puts "world"} ] end let(:code) { lines.join($/) } it "should indent each line" do expect(subject.pre(code)).to be == lines.map { |line| " #{line}" }.join($/) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ore-0.11.0 | spec/template/helpers/rdoc_spec.rb |