mirror of
https://github.com/openSUSE/osem.git
synced 2026-02-01 01:31:01 -05:00
14 lines
282 B
Ruby
14 lines
282 B
Ruby
module Flash
|
|
def flash
|
|
results = all(:css, 'div#flash p')
|
|
if results.empty?
|
|
return 'none'
|
|
end
|
|
if results.count > 1
|
|
texts = results.map { |r| r.text }
|
|
fail "One flash expected, but we had #{texts.inspect}"
|
|
end
|
|
results.first.text
|
|
end
|
|
end
|