Sha256: bf77f6307c9874c493d31aae76785080457f75e2010be77f62e5cf27b5503842

Contents?: true

Size: 716 Bytes

Versions: 6

Compression:

Stored size: 716 Bytes

Contents

require 'spec_helper'

describe Slacken::Filters::ElimBlanks, dsl: true do
  describe '#valid?' do
    subject { described_class.new.valid?(component) }

    context 'when a component obviously having no blanks is given' do
      let(:component) do
        c(:div, text('hello world!'))
      end

      it { is_expected.to be_truthy }
    end

    context 'when a component with blank component.derive is given' do
      let(:component) do
        c(:div, text(''), c(:div), c(:span))
      end

      it { is_expected.to be_falsey }
    end

    context 'when a component with a img is given' do
      let(:component) do
        c(:div, c(:img))
      end

      it { is_expected.to be_truthy }
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
slacken-0.1.6 spec/slacken/filters/elim_blanks_spec.rb
slacken-0.1.5 spec/slacken/filters/elim_blanks_spec.rb
slacken-0.1.4 spec/slacken/filters/elim_blanks_spec.rb
slacken-0.1.3 spec/slacken/filters/elim_blanks_spec.rb
slacken-0.1.2 spec/slacken/filters/elim_blanks_spec.rb
slacken-0.1.1 spec/slacken/filters/elim_blanks_spec.rb