Sha256: a4f49d0fed6587e0366e2271a5fe5425849f55329c5334d2b28ccd309fca5b8c

Contents?: true

Size: 685 Bytes

Versions: 14

Compression:

Stored size: 685 Bytes

Contents

require './test/test_helper'

describe WebFont::Index do
  describe '.download' do

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

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

      file    = File.open("#{WebFont::Index.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

14 entries across 14 versions & 1 rubygems

Version Path
web_font-0.2.0 test/lib/web_font/index_test.rb
web_font-0.1.14 test/lib/web_font/index_test.rb
web_font-0.1.13 test/lib/web_font/index_test.rb
web_font-0.1.12 test/lib/web_font/index_test.rb
web_font-0.1.11 test/lib/web_font/index_test.rb
web_font-0.1.10 test/lib/web_font/index_test.rb
web_font-0.1.9 test/lib/web_font/index_test.rb
web_font-0.1.7 test/lib/web_font/index_test.rb
web_font-0.1.6 test/lib/web_font/index_test.rb
web_font-0.1.5 test/lib/web_font/index_test.rb
web_font-0.1.4 test/lib/web_font/index_test.rb
web_font-0.1.3 test/lib/web_font/index_test.rb
web_font-0.1.2 test/lib/web_font/index_test.rb
web_font-0.1.1 test/lib/web_font/index_test.rb