Sha256: 6f7804ae7f66b3b92420a8b962488c6eab23cdaa235f8b6f240e5b08b8cba22d

Contents?: true

Size: 1.3 KB

Versions: 5

Compression:

Stored size: 1.3 KB

Contents

require 'dnote/notes'

Case DNote::Notes do

  Concern "Full coverage of DNote::Notes class."

  Unit :paths

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

  Unit :labels= => 'changes the list of labels' do
    notes = DNote::Notes.new([])
    notes.labels = [:CHOICE]
    notes.labels.assert == ['CHOICE']
  end

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

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

  Unit :files

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

  Unit :match_common
  Unit :to_xml
  Unit :notes
  Unit :to
  Unit :initialize_defaults
  Unit :parse
  Unit :to_yaml
  Unit :to_json
  Unit :counts
  Unit :organize
  Unit :display

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dnote-1.1.4 test/cases/notes_case.rb
dnote-1.1.3 test/cases/notes_case.rb
dnote-1.1.2 test/cases/notes_case.rb
dnote-1.1.1 test/cases/notes_case.rb
dnote-1.1 test/cases/notes_case.rb