Sha256: 5d5a0e82390d40879966e575679a1578332ccd1d6845b4313d459ce131f04015

Contents?: true

Size: 1.47 KB

Versions: 5

Compression:

Stored size: 1.47 KB

Contents

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

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

  def test_inspect_gives_original_name
    m = @source_parser.find_object("Foo::Bar#method_with_code_example")
    assert_match /Foo::Bar#method_with_code_example/, m.inspect
  end

  def test_grade_is_not_nil
    m = @source_parser.find_object("Foo::Bar#method_with_code_example")
    assert m.grade
  end

  def test_method_with_code_example
    m = @source_parser.find_object("Foo::Bar#method_with_code_example")
    assert m.has_code_example?
  end

  def test_method_with_code_example2
    m = @source_parser.find_object("Foo::Bar#method_with_code_example2")
    assert m.has_code_example?
  end

  def test_method_with_code_examples
    m = @source_parser.find_object("Foo::Bar#method_with_one_example")
    assert m.has_code_example?
    refute m.has_multiple_code_examples?
  end

  def test_method_with_code_examples
    m = @source_parser.find_object("Foo::Bar#method_with_examples")
    assert m.has_multiple_code_examples?
  end

  def test_method_with_code_examples
    m = @source_parser.find_object("Foo::Bar#method_with_tagged_example")
    assert m.has_multiple_code_examples?
  end

  def test_method_with_code_examples
    m = @source_parser.find_object("Foo::Bar#method_with_2tagged_examples")
    assert m.has_multiple_code_examples?
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inch-0.2.3 test/inch/code_object/proxy_test.rb
inch-0.2.2 test/inch/code_object/proxy_test.rb
inch-0.2.1 test/inch/code_object/proxy_test.rb
inch-0.2.0 test/inch/code_object/proxy_test.rb
inch-0.1.4 test/inch/code_object/proxy_test.rb