spec/djvu_numberer_spec.rb in djvu-tools-0.0.1 vs spec/djvu_numberer_spec.rb in djvu-tools-0.1.0

- old
+ new

@@ -27,9 +27,17 @@ @numberer.instance_eval{ @djvu }.should_receive(:title_page).with(n, "#{section[:start] + i}") end @numberer.add_section section end + it "titles a range of pages with delta spacing" do + section = { start: 42, range: (10..20), type: :arabic, delta: 3 } + section[:range].each_with_index do |n, i| + @numberer.instance_eval{ @djvu }.should_receive(:title_page).with(n, "#{section[:start] + i * section[:delta]}") + end + @numberer.add_section section + end + it "titles a range of pages with uppercase roman numerals" do section = { start: 3, range: (10..11), type: :upper_roman } @numberer.instance_eval{ @djvu }.should_receive(:title_page).with(10, "III") @numberer.instance_eval{ @djvu }.should_receive(:title_page).with(11, "IV") @numberer.add_section section \ No newline at end of file