Sha256: b0daaa4d65c03273ed7d973eb23c1921586bbced98c13167226f9f96f79bd3ad

Contents?: true

Size: 931 Bytes

Versions: 48

Compression:

Stored size: 931 Bytes

Contents

$:.unshift(File.dirname(__FILE__))
require 'spec_helper'

describe "title_anchor plugin" do
	def setup_title_anchor_plugin(mode)
		fake_plugin(:title_anchor) { |plugin|
			plugin.mode = mode
			plugin.conf.index = ''
			plugin.conf.html_title = "HsbtDiary"
		}
	end

	describe "in day mode" do
		before do
			@plugin = setup_title_anchor_plugin('day')
		end

		it { expect(@plugin.title_anchor).to  eq(expected_html_title_in_day(
				:index => '',
				:html_title => 'HsbtDiary'))}
	end

	describe "in latest mode" do
		before do
			@plugin = setup_title_anchor_plugin('latest')
		end

		it { expect(@plugin.title_anchor).to  eq(expected_html_title_in_latest(
				:html_title => 'HsbtDiary'))}
	end

	def expected_html_title_in_day(options)
		expected = %{<h1><a href="#{options[:index]}">#{options[:html_title]}</a></h1>}
	end

	def expected_html_title_in_latest(options)
		expected = %{<h1>#{options[:html_title]}</h1>}
	end
end

Version data entries

48 entries across 42 versions & 2 rubygems

Version Path
tdiary-contrib-5.0.10 spec/title_anchor_spec.rb
tdiary-contrib-5.0.9 spec/title_anchor_spec.rb
tdiary-contrib-5.0.8 spec/title_anchor_spec.rb
tdiary-contrib-5.0.7 spec/title_anchor_spec.rb
tdiary-contrib-5.0.6 spec/title_anchor_spec.rb
tdiary-contrib-5.0.5 spec/title_anchor_spec.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/spec/title_anchor_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-fa9c20aa0d97/spec/title_anchor_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/spec/title_anchor_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-a3c5f37278c4/spec/title_anchor_spec.rb
tdiary-5.0.5 vendor/bundle/bundler/gems/tdiary-contrib-f08988dfa0f6/spec/title_anchor_spec.rb
tdiary-contrib-5.0.4 spec/title_anchor_spec.rb
tdiary-5.0.4 vendor/bundle/bundler/gems/tdiary-contrib-8299b30cbf3f/spec/title_anchor_spec.rb
tdiary-contrib-5.0.3 spec/title_anchor_spec.rb
tdiary-contrib-5.0.2 spec/title_anchor_spec.rb
tdiary-contrib-5.0.1 spec/title_anchor_spec.rb
tdiary-contrib-5.0.0 spec/title_anchor_spec.rb
tdiary-contrib-4.2.1 spec/title_anchor_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/bundler/gems/tdiary-contrib-d189eb6688f1/spec/title_anchor_spec.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/bundler/gems/tdiary-contrib-2ab36447ae2a/spec/title_anchor_spec.rb