Skip to content

Commit

Permalink
test: mark the jruby tests from sparklemotion#2379 as pending
Browse files Browse the repository at this point in the history
See context in sparklemotion#2380. The fix on JRuby is expensive and is probably
not worth the investment of developer time right now.

But let's preserve those failures as a known issue by introducing the
`pending` and `pending_if` test helpers.
  • Loading branch information
flavorjones committed Dec 22, 2021
1 parent ca200c5 commit 469163e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
14 changes: 14 additions & 0 deletions test/helper.rb
Expand Up @@ -196,6 +196,20 @@ def assert_not_send(send_ary, m = nil)
refute(recv.__send__(msg, *args), m)
end unless method_defined?(:assert_not_send)

def pending(msg)
begin
yield
rescue MiniTest::Assertion
skip("pending #{msg}")
end
flunk("pending test unexpectedly passed: #{msg}")
end

def pending_if(msg, pend_eh, &block)
return yield unless pend_eh
pending(msg, &block)
end

def i_am_ruby_matching(gem_version_requirement_string)
Gem::Requirement.new(gem_version_requirement_string).satisfied_by?(Gem::Version.new(RUBY_VERSION))
end
Expand Down
8 changes: 6 additions & 2 deletions test/xml/test_node.rb
Expand Up @@ -1273,7 +1273,9 @@ def test_wrap
eoxml

set = xml.search("//b")
assert_equal(3, set[0].line)
pending_if("https://github.com/sparklemotion/nokogiri/issues/2380", Nokogiri.jruby?) do
assert_equal(3, set[0].line)
end
end

it "properly numbers lines with documents containing XML comments" do
Expand Down Expand Up @@ -1307,7 +1309,9 @@ def test_wrap
eoxml

set = xml.search("//c")
assert_equal(6, set[0].line)
pending_if("https://github.com/sparklemotion/nokogiri/issues/2380", Nokogiri.jruby?) do
assert_equal(6, set[0].line)
end
end

it "returns a sensible line number for each node" do
Expand Down

0 comments on commit 469163e

Please sign in to comment.