Sha256: 8bceba941a247e7de001d0fb81c3d172526aacbef330b985cdd2cb76acd76ad5

Contents?: true

Size: 791 Bytes

Versions: 3

Compression:

Stored size: 791 Bytes

Contents

$LOAD_PATH.unshift File.expand_path("../lib/cveparser/")
require 'parser'
require 'test/unit'

class TestCveParser < Test::Unit::TestCase
  
  include FIDIUS::NVDParser
  
  def test_should_parse_2_0_only
    assert_raise(RuntimeError) { FIDIUS::NVDParser.parse_cve_file 'test_v2.xml' }
  end
  
  def test_should_find_1_reference
    entries = FIDIUS::NVDParser.parse_cve_file 'test_references.xml'
    assert_equal 1, entries.first.references.size, "The test_references.xml " +
        "contains one reference which should be found."
  end
  
  def test_should_find_3_nvd_entries
    entries = FIDIUS::NVDParser.parse_cve_file 'test_entries.xml'
    assert_equal 3, entries.size, "The test_entries.xml contains 3 NVD " +
        "entries which should be returned in an array."
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fidius-cvedb-0.0.5 test/cve_parser_test.rb
fidius-cvedb-0.0.3 test/cve_parser_test.rb
fidius-cvedb-0.0.2 test/cve_parser_test.rb