Forum: RSpec regular expression hang ruby.exe

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Mattias A. (Guest)
on 2013-05-08 11:22

I use an regular expression to verify that my string in time_on_site is
correct. This works when the string match, but if it doesn't the test
get hanged. So I need to quit(ctrl+c) the script and also close ruby.exe
*32 in Task manager. Any ides how I can handle this?

time_on_site.should match(/^00:[0-5][0-9]$/)

Best regards
Mattias A. (Guest)
on 2013-05-08 11:42
If I use below it returns correct output. Can I use something similar
with Rspec so the test fails if its not true?

if time_on_site =~ /^00:[0-5][0-9]$/
    puts "# Successful match"
    puts "# Match attempt failed"
This topic is locked and can not be replied to.