summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_require.rb
blob: 4cc53e6c6cb9f48fdaa2b1c5dfbf82ebb38f097a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true
require_relative 'xref_test_case'

class TestRDocRequire < XrefTestCase

  def setup
    super

    @req = RDoc::Require.new 'foo', 'comment'
  end

  def test_initialize
    assert_equal 'foo', @req.name

    RDoc::Require.new '"foo"', ''
    assert_equal 'foo', @req.name

    RDoc::Require.new '\'foo\'', ''
    assert_equal 'foo', @req.name

    RDoc::Require.new '|foo|', ''
    assert_equal 'foo', @req.name, 'for fortran?'
  end

end