Sha256: 6318510a97f9e751024e2425bf30ab32b8b6788c7113067079cb1966b5d4429f

Contents?: true

Size: 949 Bytes

Versions: 9

Compression:

Stored size: 949 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

describe ::Inch::SourceParser do
  before do
    Dir.chdir fixture_path(:simple)
    @source_parser = Inch::SourceParser.run(["lib/**/*.rb"])
  end

  it "should parse all objects" do
    refute_nil @source_parser.find_object("Foo")
    refute_nil @source_parser.find_object("Foo::Bar")
    refute_nil @source_parser.find_object("Foo::Bar#method_without_doc")
    refute_nil @source_parser.find_object("Foo::Bar#method_with_missing_param_doc")
    refute_nil @source_parser.find_object("Foo::Bar#method_with_wrong_doc")
    refute_nil @source_parser.find_object("Foo::Bar#method_with_full_doc")
  end

  it "should return the correct depth for each object" do
    assert_equal 1, @source_parser.find_object("Foo").depth
    assert_equal 2, @source_parser.find_object("Foo::Bar").depth
    assert_equal 3, @source_parser.find_object("Foo::Bar#method_without_doc").depth
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
inch-0.2.3 test/inch/source_parser_test.rb
inch-0.2.2 test/inch/source_parser_test.rb
inch-0.2.1 test/inch/source_parser_test.rb
inch-0.2.0 test/inch/source_parser_test.rb
inch-0.1.4 test/inch/source_parser_test.rb
inch-0.1.3 test/inch/source_parser_test.rb
inch-0.1.2 test/inch/source_parser_test.rb
inch-0.1.1 test/inch/source_parser_test.rb
inch-0.1.0 test/inch/source_parser_test.rb