class Test::Unit::TestAssertEmpty

Public Instance Methods

test_fail() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2086
def test_fail
  check_fail("<[1]> was expected to be empty.") do
    assert_empty([1])
  end
end
test_fail_because_no_empty_method() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2099
def test_fail_because_no_empty_method
  object = Object.new
  inspected_object = AssertionMessage.convert(object)
  check_fail("The object must respond to :empty?.\n" +
              "<#{inspected_object}>.respond_to?(:empty?) expected\n" +
              "(Class: <Object>)") do
    assert_empty(object)
  end
end
test_fail_with_message() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2092
def test_fail_with_message
  check_fail("message.\n" +
              "<[1]> was expected to be empty.") do
    assert_empty([1], "message")
  end
end
test_pass() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2074
def test_pass
  check_nothing_fails do
    assert_empty([])
  end
end
test_pass_with_message() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2080
def test_pass_with_message
  check_nothing_fails do
    assert_empty([], "message")
  end
end