class Test::Unit::TestAssertInclude

Public Instance Methods

test_fail() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2004
def test_fail
  check_fail("<[1, 2, 3]> was expected to include\n" +
              "<4>.") do
    assert_include([1, 2, 3], 4)
  end
end
test_fail_because_not_collection_like_object() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2019
def test_fail_because_not_collection_like_object
  object = Object.new
  inspected_object = AssertionMessage.convert(object)
  check_fail("The collection must respond to :include?.\n" +
              "<#{inspected_object}>.respond_to?(:include?) expected\n" +
              "(Class: <Object>)") do
    assert_include(object, 1)
  end
end
test_fail_with_message() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 2011
def test_fail_with_message
  check_fail("message.\n" +
              "<[1, 2, 3]> was expected to include\n" +
              "<4>.") do
    assert_include([1, 2, 3], 4, "message")
  end
end
test_pass() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 1992
def test_pass
  check_nothing_fails do
    assert_include([1, 2, 3], 1)
  end
end
test_pass_with_message() click to toggle source
# File test-unit-3.3.4/test/test-assertions.rb, line 1998
def test_pass_with_message
  check_nothing_fails do
    assert_include([1, 2, 3], 1, "message")
  end
end