Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: ensure that nokogumbo 2.0.4 and 2.0.5 both work #2279

Merged
merged 1 commit into from Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/test-gem-install
Expand Up @@ -38,4 +38,5 @@ rake test

# delete the Gemfile because that's confusing to older versions of rubygems (e.g., bionic32)
rm -f Gemfile Gemfile.lock
./scripts/test-nokogumbo-compatibility
./scripts/test-nokogumbo-compatibility 2.0.4
./scripts/test-nokogumbo-compatibility 2.0.5
20 changes: 15 additions & 5 deletions scripts/test-nokogumbo-compatibility
Expand Up @@ -22,18 +22,26 @@ raise "could not find installed gem" unless gemspec

require "bundler/inline"

nokogumbo_version = if ARGV[0] =~ /\d+\.\d+\.\d+/
ARGV[0]
end

gemfile(true) do
source "https://rubygems.org"
gem "minitest"
gem "minitest-reporters"
gem "nokogiri", "=#{gemspec.version}"
gem "nokogumbo"
if nokogumbo_version
gem "nokogumbo", "=#{nokogumbo_version}"
else
gem "nokogumbo"
end
end

nokogumbo_gemspec = Gem::Specification.find_by_name('nokogumbo')
nokogumbo_gemspec = Gem::Specification.find_by_name("nokogumbo")

require 'nokogumbo'
require 'yaml'
require "nokogumbo"
require "yaml"

if ARGV.include?("-v")
puts "---------- Nokogiri version info ----------"
Expand All @@ -54,6 +62,8 @@ Minitest::Reporters.use!([Minitest::Reporters::SpecReporter.new])
puts "Testing #{gemspec.full_name} installed in #{gemspec.base_dir}"
describe gemspec.full_name do
it "works" do
assert(Nokogiri::HTML5::Document.parse("<div>ahoy</div>"))
doc = Nokogiri::HTML5::Document.parse("<div>ahoy</div>")
assert(doc)
assert_equal("ahoy", doc.at_css("/html/body/div").text)
end
end