Skip to content

Instantly share code, notes, and snippets.

def ask message, answer = /.*/, add_options_string = answer == /.*/ ? false : true
message = message + ' (' + answer.source + ')' if add_options_string
begin
print message
input = STDIN.gets.chomp
end while input !~ /^#{answer}$/
input
end
assert_have_xpath("//table[@id='items']/tr[@id='item_row_#{id}' and position()=#{position}]")