diff options
| author | Marat Radchenko <marat@slonopotamus.org> | 2020-05-18 11:27:52 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-18 11:27:52 +0300 |
| commit | 6f876a571563cad1901da3c42312b76ee97e3846 (patch) | |
| tree | 9d6961f6375e4fce4242522a5a666dd687466127 /spec | |
| parent | a63c83eb15db0a5b7e75f6f87a28094ba2beba1d (diff) | |
resolves #334 add remote media URLs to EPUB manifest (#335)
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/converter_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/converter_spec.rb b/spec/converter_spec.rb index 3d1e24e..2ac2cb7 100644 --- a/spec/converter_spec.rb +++ b/spec/converter_spec.rb @@ -249,6 +249,21 @@ text3 expect(video.media_type).to eq('video/webm') end + it 'supports remote video' do + book, = to_epub <<~EOS += Article + +video::http://nonexistent/small.webm[] + EOS + article = book.item_by_href '_article.xhtml' + expect(article).not_to be_nil + expect(article['properties']).to include('remote-resources') + expect(article.content).to include '<video src="http://nonexistent/small.webm" controls="controls">' + video = book.item_by_href 'http://nonexistent/small.webm' + expect(video).not_to be_nil + expect(video.media_type).to eq('video/webm') + end + it 'supports audio' do book, = to_epub fixture_file('audio/book.adoc') chapter = book.item_by_href '_chapter.xhtml' @@ -259,6 +274,21 @@ text3 expect(audio.media_type).to eq('audio/mpeg') end + it 'supports remote audio' do + book, = to_epub <<~EOS += Article + +audio::http://nonexistent/small.mp3[] + EOS + article = book.item_by_href '_article.xhtml' + expect(article).not_to be_nil + expect(article['properties']).to include('remote-resources') + expect(article.content).to include '<audio src="http://nonexistent/small.mp3" controls="controls">' + audio = book.item_by_href 'http://nonexistent/small.mp3' + expect(audio).not_to be_nil + expect(audio.media_type).to eq('audio/mpeg') + end + it 'supports horizontal dlist' do book = to_epub <<~EOS = Article |
