Sha256: e63a18a357d065cae10e38a244ebdc47d048f9d612de76bf15b428e1e43e52a6

Contents?: true

Size: 1.22 KB

Versions: 8

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'

describe Fontrobot do
  let(:input_dir) { 'spec/fixtures/vectors' }
  let(:output_dir) { 'tmp' }
  let(:fake_file) { output_dir + '/non-vector.txt' }

  context 'when ouput_dir already contains files' do
    # Compile, add non-fontrobot file, change input vectors, recompile
    before(:all) do
      # originals
      Fontrobot.compile(input_dir, '-o', output_dir, '-n', 'Original Font')
      FileUtils.touch(fake_file, :verbose => true)
      @original_fonts = Dir[output_dir + '/fontrobot-*.{woff,eot,ttf,svg}']
      @original_css = File.read(output_dir + '/fontrobot.css')

      FileUtils.mv(input_dir + '/C.svg', input_dir + '/E.svg', :verbose => true)
      Fontrobot.compile(input_dir, '-o', output_dir)
    end

    after(:all) do
      cleanup(output_dir)
      FileUtils.mv(input_dir + '/E.svg', input_dir + '/C.svg', :verbose => true)
    end

    it 'should delete previous fontrobot generated files' do
      new_files = Dir[output_dir + '/*']
      @original_fonts.each do |original|
        new_files.should_not include(original)
      end
    end

    it 'should generate different css' do
      new_css = File.read(output_dir + '/fontrobot.css')
      new_css.should_not equal(@original_css)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fontrobot-0.1.8 spec/fontrobot/fontrobot_spec.rb
fontrobot-0.1.7 spec/fontrobot/fontrobot_spec.rb
fontrobot-0.1.6 spec/fontrobot/fontrobot_spec.rb
fontrobot-0.1.5 spec/fontrobot/fontrobot_spec.rb
fontrobot-0.1.4 spec/fontrobot/fontcustom_spec.rb
fontrobot-0.1.3 spec/fontrobot/fontcustom_spec.rb
fontrobot-0.1.2 spec/fontrobot/fontcustom_spec.rb
fontrobot-0.1 spec/fontrobot/fontcustom_spec.rb