Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uninitialized constant EPUBMaker::ZIPExporter::Zipエラー #713

Closed
kmuto opened this issue Dec 31, 2016 · 2 comments
Closed

uninitialized constant EPUBMaker::ZIPExporter::Zipエラー #713

kmuto opened this issue Dec 31, 2016 · 2 comments

Comments

@kmuto
Copy link
Owner

kmuto commented Dec 31, 2016

Ruby2.1 + test-unitでのテスト実行時にエラーが起きてる…のはzip gemがないからか。
うーん。これもgemがなければテストスキップしたいなぁ。
「gemがあってより便利になる」のはいいけど、「gemがないとあちこち動かない」のは嫌なのです。

Error: test_export_rubyzip(ZipExporterTest): NameError: uninitialized constant EPUBMaker::ZipExporter::Zip
/work/review/lib/epubmaker/zip_exporter.rb:61:in `block in export_zip_rubyzip'
/work/review/lib/epubmaker/zip_exporter.rb:60:in `chdir'
/work/review/lib/epubmaker/zip_exporter.rb:60:in `export_zip_rubyzip'
/work/review/test/test_zip_exporter.rb:90:in `test_export_rubyzip'
     87:     params = {"epubmaker"=>{}}
     88:     epubfile = File.join(@tmpdir, "test.epub")
     89:     exporter = ZipExporter.new(@epubdir, params)
  => 90:     exporter.export_zip_rubyzip(epubfile)
     91:     assert_true(File.exist?(epubfile))
     92: 
     93:     File.open(epubfile) do |f|
================================================================================
E
================================================================================
Error: test_export_zipcmd(ZipExporterTest): NameError: uninitialized constant Zip
/work/review/test/test_zip_exporter.rb:77:in `block in test_export_zipcmd'
     74:     assert_true(File.exist?(epubfile))
     75: 
     76:     File.open(epubfile) do |f|
  => 77:       ::Zip::InputStream.open(f) do |fzip|
     78:         ## get first entry
     79:         entry = fzip.get_next_entry
     80:         assert_equal "mimetype", entry.name
/work/review/test/test_zip_exporter.rb:76:in `open'
/work/review/test/test_zip_exporter.rb:76:in `test_export_zipcmd'
@takahashim
Copy link
Collaborator

なるほど…。
pure rubyのライブラリがない環境での細かいテストは頑張るポイントではなさそうなので、zipが作られるところまでテストして、zipファイルの中身の確認(先頭に来るファイルがmimetype)まではしなくてもいいですかね。

@kmuto
Copy link
Owner Author

kmuto commented Dec 31, 2016

ありがとうございます

@kmuto kmuto closed this as completed Dec 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants