File: test_faker_vulnerability_identifier.rb

package info (click to toggle)
ruby-faker 3.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,596 kB
  • sloc: ruby: 20,656; sh: 6; makefile: 6
file content (17 lines) | stat: -rw-r--r-- 375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

require_relative '../../test_helper'

class TestFakerVulnerabilityIdentifier < Test::Unit::TestCase
  def setup
    @tester = Faker::VulnerabilityIdentifier
  end

  def test_cve_no_args
    assert_match(/^CVE-\d{4}-\d{4,}$/, @tester.cve)
  end

  def test_cve_with_year
    assert_match(/^CVE-2012-\d{4,}$/, @tester.cve(year: 2012))
  end
end