Sha256: b4d7b40384246190dbe1907aa3bb9ff0e565ba99f2f2431a0ad4d2062f3f1f5d

Contents?: true

Size: 770 Bytes

Versions: 3

Compression:

Stored size: 770 Bytes

Contents

require 'spec_helper'

describe WrapIt::Base, type: :wrapped do
  it 'have #tag getter' do
    expect(successor.tag).to eq 'div'
  end

  it 'have default_tag class method' do
    successor_class.class_eval { default_tag 'a' }
    expect(successor.tag).to eq 'a'
  end

  it 'gets tag name from options' do
    expect(successor(tag: 'p').tag).to eq 'p'
  end

  it 'calls after_initialize' do
    successor_class.class_eval { after_initialize { html_class << :a } }
    expect(successor.html_class).to eq %w(a)
  end

  it 'not omits content by default' do
    expect(successor.omit_content?).to be_false
  end

  it 'provides way to omit content in subclasses' do
    successor_class.class_eval { omit_content }
    expect(successor.omit_content?).to be_true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wrap_it-1.0.2 spec/lib/base_spec.rb
wrap_it-1.0.1 spec/lib/base_spec.rb
wrap_it-1.0.0 spec/lib/base_spec.rb