Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'nokogiri'
- require 'test/unit'
- class AssertSelectorTest < Test::Unit::TestCase
- def setup
- @doc = Nokogiri::HTML(<<-eohtml)
- <html>
- <body>
- <p>Hello world!</p>
- </body>
- </html>
- eohtml
- end
- def test_make_sure_that_have_selector_works
- have_selector('p', @doc)
- end
- def have_selector expected_selector, document, msg = nil
- assert document.css(expected_selector).length > 0, msg
- end
- end
Add Comment
Please, Sign In to add comment