Sha256: e2f549b52bdbccf39bc2aecb6857de3645c987321130a88e62e71acf22e44cde

Contents?: true

Size: 1.31 KB

Versions: 3

Compression:

Stored size: 1.31 KB

Contents

require 'dnote/notes'

Case DNote::Notes do

  Concern "Coverage of DNote::Notes class."

  Unit :labels => 'returns the list of labels' do
    notes = DNote::Notes.new([], :labels=>['TODO'])
    notes.labels.assert == ['TODO'] #DNote::Notes::DEFAULT_LABELS
  end

  Unit :files => 'returns the files attribute' do
    notes = DNote::Notes.new(["example1.rb"])
    notes.assert.files == ["example1.rb"]
    notes = DNote::Notes.new([], :paths => ["example2.rb"])
    notes.assert.files == ["example2.rb"]
  end

  Unit :files= => 'changes the paths attribute' do
    notes = DNote::Notes.new([])
    notes.files = ["example1.rb"]
    notes.assert.files == ["example1.rb"]
  end

  Unit :match_general => '' do
    notes = DNote::Notes.new([])
    line, lineno, file = "# TODO: Do something or another!", 1, "foo.rb"
    rec = notes.match_general(line, lineno, file)
    rec.to_h.assert == {'label'=>"TODO",'file'=>file,'line'=>lineno,'text'=>"Do something or another!"}
  end

  Unit :match_specail => '' do
    notes = DNote::Notes.new([], :labels=>['TODO'])
    line, lineno, file = "# TODO: Do something or another!", 1, "foo.rb"
    rec = notes.match_special(line, lineno, file)
    rec.to_h.assert == {'label'=>"TODO",'file'=>file,'line'=>lineno,'text'=>"Do something or another!"}
  end

  Unit :counts
  Unit :notes
  Unit :parse

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dnote-1.4.0 test/notes_case.rb
dnote-1.3.1 test/notes_case.rb
dnote-1.3.0 test/notes_case.rb