Ad
  • Custom User Avatar

    assert_equals should be used

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The following test case is erroneous:

    should return false for 'joe@example'

    Though it is discouraged by ICANN, an e-mail address with no dot (using a local domain name) is still a valid e-mail address per RFC.

  • Custom User Avatar

    Needs random tests

  • Default User Avatar

    Many of the tests require true/false values, whereas idiomatic Ruby allows for truthy and falsey values in situations like this. (The fact that some but not all of the tests require true/false makes failures even more confusing.) A number of previous comments on this kata seem to stem from this feature of the tests.

    I would recommend changing all positive tests like Test.expect(validate( 'joe.m@server.com') == true) to Test.expect validate( 'joe.m@server.com') and all negative tests like Test.expect(validate( 'joe.m.k@server') == false) to Test.expect !validate( 'joe.m.k@server').