I want to do something like
assert_match /blah blah blah #{@user}/, @some_text
but I’m not having any luck with it working.
What am I doing wrong here?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That is the correct way to insert a variable into a regex:
So your problem is likely that the assert is failing because of a bad match. Check the value of @user and @some_text and try http://rubular.com to come up with a matching regexp