Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jugyo committed Sep 19, 2011
1 parent d561717 commit d01c384
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/eeepub/ocf.rb
Expand Up @@ -110,7 +110,7 @@ def save(output_path)
# @return [String] streaming output of the zip/epub file.
def render
create_epub do
temp_file = Tempfile.new
temp_file = Tempfile.new("ocf")
self.save(temp_file.path)
return temp_file.read
end
Expand Down
10 changes: 6 additions & 4 deletions spec/eeepub/maker_spec.rb
Expand Up @@ -28,7 +28,7 @@
it { @maker.instance_variable_get(:@creators).should == ['jugyo'] }
it { @maker.instance_variable_get(:@publishers).should == ['jugyo.org'] }
it { @maker.instance_variable_get(:@dates).should == ["2010-05-06"] }
it { @maker.instance_variable_get(:@identifiers).should == [{:value => 'http://example.com/book/foo', :scheme => 'URL'}] }
it { @maker.instance_variable_get(:@identifiers).should == [{:value => 'http://example.com/book/foo', :scheme => 'URL', :id => nil}] }
it { @maker.instance_variable_get(:@uid).should == 'http://example.com/book/foo' }
it { @maker.instance_variable_get(:@ncx_file).should == 'toc.ncx' }
it { @maker.instance_variable_get(:@opf_file).should == 'content.opf' }
Expand All @@ -49,7 +49,7 @@
{:label => '1. foo', :content => 'foo.html'},
{:label => '1. bar', :content => 'bar.html'}
],
:uid => "http://example.com/book/foo"
:uid=>{:value=>"http://example.com/book/foo", :scheme=>"URL", :id=>"http://example.com/book/foo"}
) { stub!.save }
mock(EeePub::OPF).new(
:title => ["sample"],
Expand All @@ -62,7 +62,8 @@
:relation => ['xxx'],
:ncx => "toc.ncx",
:publisher => ["jugyo.org"],
:identifier => [{:value => "http://example.com/book/foo", :scheme => "URL"}],
:unique_identifier=>"http://example.com/book/foo",
:identifier => [{:value => "http://example.com/book/foo", :scheme => "URL", :id => "http://example.com/book/foo"}],
:manifest => ['foo.html', 'bar.html']
) { stub!.save }
mock(EeePub::OCF).new(
Expand Down Expand Up @@ -113,7 +114,8 @@
:relation => ['xxx'],
:ncx => "toc.ncx",
:publisher => ["jugyo.org"],
:identifier => [{:value => "http://example.com/book/foo", :scheme => "URL"}],
:unique_identifier=>"http://example.com/book/foo",
:identifier => [{:value => "http://example.com/book/foo", :scheme => "URL", :id=>"http://example.com/book/foo"}],
:manifest => ["foo/bar/foo.html", "foo/bar/baz/bar.html"]
) { stub!.save }
mock(EeePub::OCF).new.with_any_args { stub!.save }
Expand Down
3 changes: 2 additions & 1 deletion spec/eeepub/ocf_spec.rb
Expand Up @@ -42,8 +42,9 @@
end

it 'should stream epub' do
pending
output = @ocf.render
output.size.should == 523
output.size.should == 134
output.is_binary_data?.should be_true
end
end

0 comments on commit d01c384

Please sign in to comment.