-
-
Notifications
You must be signed in to change notification settings - Fork 899
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Nokogumbo's contract expectations
See rubys/nokogumbo#171 which introduced forward-looking behavior to integrate with a future Nokogiri::HTML5 after the Nokogumbo merger. These tests, which are failing right now, will drive much of the rest of the integration work.
- Loading branch information
1 parent
9865ea6
commit ace2351
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "helper" | ||
|
||
describe "Nokogumbo contract expectations" do | ||
# per https://github.com/rubys/nokogumbo/pull/171 | ||
it "includes the HTML5 public interface" do | ||
skip("Gumbo is not supported on this platform") unless Nokogiri.uses_gumbo? | ||
|
||
assert_includes(::Nokogiri.singleton_methods, :HTML5) | ||
|
||
assert_equal(defined?(::Nokogiri::HTML5), "constant") | ||
assert_includes(::Nokogiri::HTML5.singleton_methods, :parse) | ||
assert_includes(::Nokogiri::HTML5.singleton_methods, :fragment) | ||
|
||
assert_equal(defined?(::Nokogiri::HTML5::Node), "constant") | ||
assert_equal(defined?(::Nokogiri::HTML5::Document), "constant") | ||
assert_equal(defined?(::Nokogiri::HTML5::DocumentFragment), "constant") | ||
end | ||
|
||
it "includes a replacement for the Nokogumbo private interface" do | ||
skip("Gumbo is not supported on this platform") unless Nokogiri.uses_gumbo? | ||
|
||
assert_equal(defined?(::Nokogiri::Gumbo), "constant") | ||
assert_includes(::Nokogiri::Gumbo.singleton_methods, :parse) | ||
assert_includes(::Nokogiri::Gumbo.singleton_methods, :fragment) | ||
end | ||
end |