Sha256: f24d0a4626e7b3f4e8a4037c1f95803f3db252046f62e80191f3fdd5d83caa90

Contents?: true

Size: 669 Bytes

Versions: 2

Compression:

Stored size: 669 Bytes

Contents

require 'spec_helper'

describe WrapIt::Link do
  it 'has `a` tag by default' do
    expect(successor.tag).to eq 'a'
  end

  it { expect(successor).to be_kind_of WrapIt::TextContainer }

  it 'takes href from options' do
    [:link, :href, :url].each do |key|
      @successor = nil
      expect(successor(key => 'url').href).to eq 'url'
    end
  end

  it 'takes href from first string arg if block present' do
    expect(successor('url') { 'text' }.href).to eq 'url'
  end

  it 'takes href from second string arg if no block given' do
    expect(successor('text', 'url').href).to eq 'url'
    expect(successor.instance_variable_get(:@body)).to eq 'text'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wrap_it-0.2.0 spec/lib/link_spec.rb
wrap_it-0.1.5 spec/lib/link_spec.rb