class Test::Unit::TestTestCase::TestTestDefined::TestLine::TestDefStyle

Public Instance Methods

test_after() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 671
def test_after
  line_after = nil
  test_case = Class.new(TestCase) do
    def test_nothing
    end
    line_after = __LINE__
  end
  assert_true(test_case.test_defined?(:line => line_after))
end
test_before() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 652
def test_before
  line_before = nil
  test_case = Class.new(TestCase) do
    line_before = __LINE__
    def test_nothing
    end
  end
  assert_false(test_case.test_defined?(:line => line_before))
end
test_child() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 681
def test_child
  child_test_case = nil
  line_child = nil
  parent_test_case = Class.new(TestCase) do
    test "parent" do
    end

    child_test_case = Class.new(self) do
      line_child = __LINE__; test "child" do
      end
    end
  end
  assert_equal([
                 false,
                 true,
               ],
               [
                 parent_test_case.test_defined?(:line => line_child),
                 child_test_case.test_defined?(:line => line_child),
               ])
end
test_def() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 662
def test_def
  line_def = nil
  test_case = Class.new(TestCase) do
    line_def = __LINE__; def test_nothing
    end
  end
  assert_true(test_case.test_defined?(:line => line_def))
end
test_nothing() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 656
def test_nothing
end