Sha256: a1cf5bd3ffe651c0bef6e6e4fd6117a8c8e9ebca8b6e111871802c00691d5180

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

#require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
$:.unshift File.dirname(__FILE__)

require 'changelog_memo-parser'

describe 'ChangelogMemo::Parser' do
  let(:input_text) do
    <<-TEXT
2012-03-13 (Tue)  t.koyachi@home  <sample@test.com>

	* tag1: title1
	body-line1
	body-line2

2012-03-12 (Mon)  t.koyachi@home  <sample@test.com>

	* tag2: title2
	body2-line1

	* tag3_1, tag3_2: title3
	body3-line1
	body3-line2

TEXT
  end

  it 'should parse_text' do
    ChangelogMemo::Parser.parse_text(input_text).should ==(
      [
        ChangelogMemo::Entry.new("title1", "body-line1\nbody-line2", ["tag1"], "2012-03-13"),
        ChangelogMemo::Entry.new("title2", "body2-line1", ["tag2"], "2012-03-12"),
        ChangelogMemo::Entry.new("title3", "body3-line1\nbody3-line2", ["tag3_1", "tag3_2"], "2012-03-12"),
      ])
  end

  let(:clmemo_file_path) { File.expand_path(File.dirname(__FILE__) + '/fixture/clmemo.txt') }
  it 'should parse_file' do
    ChangelogMemo::Parser.parse_file(clmemo_file_path).should ==(
      [
        ChangelogMemo::Entry.new("title1 from clmemo.txt", "body-line1\nbody-line2", ["tag1"], "2012-03-13"),
        ChangelogMemo::Entry.new("title2 from clmemo.txt", "body2-line1", ["tag2"], "2012-03-12"),
        ChangelogMemo::Entry.new("title3 from clmemo.txt", "body3-line1\nbody3-line2", ["tag3_1", "tag3_2"], "2012-03-12"),
        ChangelogMemo::Entry.new("title4 from clmemo.txt", "body4-line1", ["tag4_1"], "2012-03-12"),
      ])
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
changelog_memo-parser-0.0.1 spec/changelog_memo-parser_spec.rb