Sha256: dcfe3cde0d8d494feb3b53ab36c2a9ec5fa53cfb9f156adbce1e0552bc3cf840

Contents?: true

Size: 754 Bytes

Versions: 13

Compression:

Stored size: 754 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

RSpec.describe Transformers::FileKeeper do
  context '#transform' do
    it 'removes directories from array and keep files' do
      slide1 = instance_double('Middleman::Presentation::NewSlide')
      file = touch_file('01.html.erb')
      allow(slide1).to receive(:path).and_return absolute_path(file)

      slide2 = instance_double('Middleman::Presentation::NewSlide')
      directory = create_dir('01_dir')
      allow(slide2).to receive(:path).and_return absolute_path(directory)

      slides = []
      slides << slide2
      slides << slide1

      slides = Transformers::FileKeeper.new.transform(slides)
      expect(slides).to include slide1
      expect(slides).not_to include slide2
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

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