Skip to content

Commit

Permalink
test: update test-gem-file-contents to look for darwin bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Dec 23, 2020
1 parent 7c5ddab commit 80010ed
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions scripts/test-gem-file-contents
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,23 @@ describe File.basename(gemfile) do
assert_operator(gemspec.extra_rdoc_files.grep(%r{ext/nokogiri/.*\.c$}).length, :>, 10)
end

it "contains expected .so files " do
it "contains expected shared library files " do
native_ruby_versions.each do |version|
assert_includes(gemfile_contents, "lib/nokogiri/#{version}/nokogiri.so")
actual = gemfile_contents.find do |p|
File.fnmatch?("lib/nokogiri/#{version}/nokogiri.{so,bundle}", p, File::FNM_EXTGLOB)
end
assert(actual, "expected to find shared library file for ruby #{version}")
end
refute_includes(gemfile_contents, "lib/nokogiri/nokogiri.so")
assert_equal(native_ruby_versions.length, Dir.glob("lib/nokogiri/**/*.so").length)

actual = gemfile_contents.find do |p|
File.fnmatch?("lib/nokogiri/nokogiri.{so,bundle}", p, File::FNM_EXTGLOB)
end
refute(actual, "did not expect to find shared library file in lib/nokogiri")

actual = gemfile_contents.find_all do |p|
File.fnmatch?("lib/nokogiri/**/*.{so,bundle}", p, File::FNM_EXTGLOB)
end
assert_equal(native_ruby_versions.length, actual.length, "did not expect extra shared library files")
end
end if gemspec.platform.is_a?(Gem::Platform) && gemspec.platform.cpu

Expand Down

0 comments on commit 80010ed

Please sign in to comment.