这对我来说没有任何意义。我试图断言这两个日期是相同的。它们看起来一样,但不知何故它们是不同的。
#assert correct time and date
assert_equal(/[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [A-Z]{2}/.match($driver.find_element(:class, "flash-information").text), /[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [A-Z]{2}/.match($driver.find_element(:class, "news_date").text))
这是我得到的失败。
F
===============================================================================
Failure: <#<MatchData "10, 2013 at 4:13 PM">> expected but was
<#<MatchData "10, 2013 at 4:13 PM">>.
39: #assert correct time and date
=> 40: assert_equal(/[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [A-Z]{2}/.match($driver.find_element(:class, "flash-information").text), /[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [A-Z]{2}/.match($driver.find_element(:class, "news_date").text))
我在测试单元中运行它