Created
July 29, 2015 11:34
-
-
Save arthurnn/38edce7b345ec8ba74d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'minitest/autorun' | |
require 'nokogiri' | |
class NokoTest < MiniTest::Unit::TestCase | |
def test_css_select_without_noscript | |
s = <<-M | |
<p class="content"> | |
<strong>Morning</strong> | |
Hi, I hope to see you soon... | |
</p> | |
M | |
node = Nokogiri::HTML(s).root | |
assert_equal s.strip, node.css('.content').to_s | |
end | |
def test_css_select_with_noscript | |
s = <<-M | |
<p class="content"> | |
<strong>Morning</strong> | |
<noscript>foo</noscript> | |
Hi, I hope to see you soon... | |
</p> | |
M | |
node = Nokogiri::HTML(s).root | |
assert_equal s.strip, node.css('.content').to_s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment