Sha256: 49872a221002d78c8d718a4245d40e279c1a83b961b4e0a9ec9f1c0493549973

Contents?: true

Size: 1.42 KB

Versions: 8

Compression:

Stored size: 1.42 KB

Contents

require 'spec_helper'

describe Rack::DevMark::Theme::Title do
  include_context "theme context"
  it_behaves_like "theme" do
    let (:out) { %Q~<html><head>head<title>(env) title</title></head><body>body</body></html>~ }
    subject { Rack::DevMark::Theme::Title.new }
  end
  context "upcase is true" do
    let (:out) { %Q~<html><head>head<title>(ENV) title</title></head><body>body</body></html>~ }
    subject { Rack::DevMark::Theme::Title.new(upcase: true) }
    it_behaves_like "theme"
  end
  context "upcase is true" do
    let (:out) { %Q~<html><head>head<title>(env) title</title></head><body>body</body></html>~ }
    subject { Rack::DevMark::Theme::Title.new(upcase: false) }
    it_behaves_like "theme"
  end
  context "type is prefix" do
    let (:out) { %Q~<html><head>head<title>(env) title</title></head><body>body</body></html>~ }
    subject { Rack::DevMark::Theme::Title.new(type: 'prefix') }
    it_behaves_like "theme"
  end
  context "type is postfix" do
    let (:out) { %Q~<html><head>head<title>title (env)</title></head><body>body</body></html>~ }
    subject { Rack::DevMark::Theme::Title.new(type: 'postfix') }
    it_behaves_like "theme"
  end
  context "no title tag" do
    let (:src) { %Q~<html><head>head</head><body>body</body></html>~ }
    let (:out) { %Q~<html><head>head</head><body>body</body></html>~ }
    it "does not insert anything" do
      expect(subject.insert_into(src)).to eq(src)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rack-dev-mark-0.4.6 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.4.5 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.4.4 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.4.3 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.4.2 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.4.1 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.4.0 spec/rack/dev-mark/theme/title_spec.rb
rack-dev-mark-0.3.0 spec/rack/dev-mark/theme/title_spec.rb