Take the 2-minute tour ×  I'm using watir-cucumber for test
automation. I wrote following method in a separate .rb, this
method is not in step definitions.   def has_logged_in?
$browser.text.should include("t788")  When I call this method
from step definition this error comes,   wrong argument type
String (expected Module) (TypeError)  the same code works fine
in step definitions. I searched around and found out that
include method is used to include module but that is ruby-
include method and should include comes under
rspec\expectations. So how do I call should include method
outside step definition like above. I'm using watir-cucumber on
linux  share|improve this question Where and why you wrote that
method? –  Ismael Abreu Oct 22 '12 at 13:35 you could do
text.should =~ /t788/ just as well –  froderik Oct 22 '12 at
14:43 @IsmaelAbreu I wanted to test if user has logged in so
instead of writing it for every step I would like to call this
function and then it will decide step is passed or failed. This
is