Sha256: 810ebe61abacbcf58f054c5006cf62bfc57ee805fa5fa62fb530a8da2190c5fa

Contents?: true

Size: 680 Bytes

Versions: 7

Compression:

Stored size: 680 Bytes

Contents

require './test/test_helper'

describe WebFont::Data do
  describe '.download' do

    it 'download google fonts data and creates index.json' do
      WebFont::Data.download

      File.exist?("#{WebFont::Data.path}/fonts.json").must_equal true
      File.exist?("#{WebFont::Data.path}/index.json").must_equal true

      file    = File.open("#{WebFont::Data.path}/index.json")
      indices = JSON.parse(file.read)
      file.close

      start = 0
      indices.each do |alphabet, hash|
        if alphabet == 'a'
          hash['start'].must_equal 0
        else
          hash['start'].must_equal start
        end

        start = hash['end'] + 1
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
web_font-0.0.7 test/lib/web_font/data_test.rb
web_font-0.0.6 test/lib/web_font/data_test.rb
web_font-0.0.5 test/lib/web_font/data_test.rb
web_font-0.0.4 test/lib/web_font/data_test.rb
web_font-0.0.3 test/lib/web_font/data_test.rb
web_font-0.0.2 test/lib/web_font/data_test.rb
web_font-0.0.1 test/lib/web_font/data_test.rb