class Test::Unit::TestTestCase::TestTestDefined::TestLine::TestMethodStyle

Public Instance Methods

test_after() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 724
def test_after
  line_after = nil
  test_case = Class.new(TestCase) do
    test "nothing" do
    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 705
def test_before
  line_before = nil
  test_case = Class.new(TestCase) do
    line_before = __LINE__
    test "nothing" do
    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 734
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_method() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 715
def test_method
  line_method = nil
  test_case = Class.new(TestCase) do
    line_method = __LINE__; test "nothing" do
    end
  end
  assert_true(test_case.test_defined?(:line => line_method))
end
test_with_setup() click to toggle source
# File test-unit-3.3.4/test/test-test-case.rb, line 756
def test_with_setup
  line = nil
  test_case = Class.new(TestCase) do
    setup do
    end

    line = __LINE__; test "with setup" do
    end
  end
  assert do
    test_case.test_defined?(:line => line,
                            :method_name => "test: with setup")
  end
end