Sha256: 2a8b2fc836245cabb331d565c01824e7fc228da0974a768f48036a8b4595d05a

Contents?: true

Size: 1.34 KB

Versions: 25

Compression:

Stored size: 1.34 KB

Contents

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

describe ::Inch::CodeObject::Proxy::Base do
  before do
    @codebase = test_codebase(:code_examples)
    @objects = @codebase.objects
  end

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

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

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

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

  def test_method_with_code_examples
    m = @objects.find("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 = @objects.find("Foo::Bar#method_with_examples")
    assert m.has_multiple_code_examples?
  end

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

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

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
inch-0.3.3 test/unit/code_object/proxy_test.rb
inch-0.3.3.rc1 test/unit/code_object/proxy_test.rb
inch-0.3.2 test/unit/code_object/proxy_test.rb
inch-0.3.2.rc2 test/unit/code_object/proxy_test.rb
inch-0.3.2.rc1 test/unit/code_object/proxy_test.rb