Sha256: 332a0d5d205785932bcdd714cd3a911c7b782d9e3c63942879c3499646ebf892

Contents?: true

Size: 723 Bytes

Versions: 13

Compression:

Stored size: 723 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

RSpec.describe CssClassExtracter do
  context '#extract' do
    it 'extract classes' do
      file = write_file 'index.html', <<-EOS.strip_heredoc
    <html class="hello">
    </html>
      EOS

      klasses = CssClassExtracter.new.extract([absolute_path(file)])
      expect(klasses.size).to eq 1
      expect(klasses.first.name).to eq 'hello'
    end

    it 'ignores classes' do
      file = write_file 'index.html', <<-EOS.strip_heredoc
    <html class="hello test">
    </html>
      EOS

      klasses = CssClassExtracter.new.extract([absolute_path(file)], ignore: ['test'])
      expect(klasses.size).to eq 1
      expect(klasses.first.name).to eq 'hello'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
middleman-presentation-core-0.17.7 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.17.6 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.17.5 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.17.2 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.17.1 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.17.0 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.3 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.2 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.0 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.0.rc2 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.0.rc1 spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.0.beta spec/css_class_extracter_spec.rb
middleman-presentation-core-0.16.0.alpha spec/css_class_extracter_spec.rb