File: output_buffer_spec.rb

package info (click to toggle)
ruby-org 0.9.12-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,852 kB
  • sloc: ruby: 3,044; lisp: 50; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 835 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
require 'spec_helper'

describe Orgmode::OutputBuffer do

  it "computes outline level numbering" do
    output_buffer = Orgmode::OutputBuffer.new ""
    expect(output_buffer.get_next_headline_number(1)).to eql("1")
    expect(output_buffer.get_next_headline_number(1)).to eql("2")
    expect(output_buffer.get_next_headline_number(1)).to eql("3")
    expect(output_buffer.get_next_headline_number(1)).to eql("4")
    expect(output_buffer.get_next_headline_number(2)).to eql("4.1")
    expect(output_buffer.get_next_headline_number(2)).to eql("4.2")
    expect(output_buffer.get_next_headline_number(1)).to eql("5")
    expect(output_buffer.get_next_headline_number(2)).to eql("5.1")
    expect(output_buffer.get_next_headline_number(2)).to eql("5.2")
    expect(output_buffer.get_next_headline_number(4)).to eql("5.2.0.1")
  end

end