def should_be_an_error(self, topic):
     expect(topic).to_be_an_error()
     expect(topic).to_be_an_error_like(openfont.errors.InvalidPackageError)
     expect(topic.errno).to_equal(2)
     fixture_path = fixture('no-package-file')
     msg = 'Path "%s" does not contain a package.json file. No openfont package could be loaded.' % fixture_path
     expect(topic.strerror).to_equal(msg)
     expect(topic.filename).to_equal(fixture_path)
 def topic(self):
     errored = 0
     valid_formats = ['woff', 'eot', 'svg', 'ttf']
     for font_format in valid_formats:
         try:
             OpenFontFileLoader(fixture('missing-fonts-%s' % font_format))
         except Exception, err:
             errored += 1
             yield (font_format, err)
 def topic(self):
     return OpenFontFileLoader(fixture('no-package-file'))
 def topic(self):
     return OpenFontFileLoader(fixture("first"))