Sha256: bd389980220c47a7ae7a0b5eb0fe08893b92a30896eab6c4f30abd5fb2934ab1

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

require 'rspec'
require 'json'
require File.expand_path('../../lib/fontcustom.rb', __FILE__)

RSpec.configure do |c|
  def fixture(path = "")
    File.join(File.expand_path('../fixtures', __FILE__), path)
  end

  # TODO more aptly named fontforge_data?
  def data_file_contents
    {
      :fonts => %w|
        fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.woff
        fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.ttf
        fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.eot
        fontcustom_cc5ce52f2ae4f9ce2e7ee8131bbfee1e.svg
      |,
      :templates => %w|fontcustom.css|,
      :glyphs => %w|a_r3ally-exotic-f1le-name c d|
    }
  end

  def fontforge_stdout
    data_file_contents.to_json.to_s
  end
  
  def fontforge_stderr
    "Copyright (c) 2000-2012 by George Williams.\n Executable based on sources from 14:57 GMT 31-Jul-2012-D.\n Library based on sources from 14:57 GMT 31-Jul-2012.\n"
  end
  
  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end
    result
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fontcustom-1.2.0 spec/spec_helper.rb
fontcustom-1.1.1 spec/spec_helper.rb
fontcustom-1.1.0 spec/spec_helper.rb