Skip to content

Commit

Permalink
dev: remove test helpers that weren't used
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Oct 14, 2023
1 parent b4a54ac commit bedc6d8
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,6 @@ module TestBase
XSLT_FILE = File.join(ASSETS_DIR, "staff.xslt")
XPATH_FILE = File.join(ASSETS_DIR, "slow-xpath.xml")

def i_am_ruby_matching(gem_version_requirement_string)
Gem::Requirement.new(gem_version_requirement_string).satisfied_by?(Gem::Version.new(RUBY_VERSION))
end

def i_am_in_a_systemd_container
File.exist?("/proc/self/cgroup") && File.read("/proc/self/cgroup") =~ %r(/docker/|/garden/)
end

def i_am_running_in_valgrind
# https://stackoverflow.com/questions/365458/how-can-i-detect-if-a-program-is-running-from-within-valgrind/62364698#62364698
ENV["LD_PRELOAD"] =~ /valgrind|vgpreload/
Expand Down Expand Up @@ -203,7 +195,6 @@ def teardown
end
when "verify"
if @@test_count % COMPACT_EVERY == 0
# https://alanwu.space/post/check-compaction/
gc_verify_compaction_references
end
GC.start(full_mark: true)
Expand All @@ -220,6 +211,7 @@ def teardown
end

def gc_verify_compaction_references
# https://alanwu.space/post/check-compaction/
if Gem::Requirement.new(">= 3.2.0").satisfied_by?(Gem::Version.new(RUBY_VERSION))
GC.verify_compaction_references(expand_heap: true, toward: :empty)
else
Expand Down Expand Up @@ -267,14 +259,6 @@ def util_decorate(document, decorator_module)
document.decorate!
end

def assert_not_send(send_ary, m = nil)
recv, msg, *args = send_ary
m = message(m) do
"Expected #{mu_pp(recv)}.#{msg}(*#{mu_pp(args)}) to return false"
end
refute(recv.__send__(msg, *args), m)
end unless method_defined?(:assert_not_send)

def pending(msg)
begin
yield
Expand Down

0 comments on commit bedc6d8

Please sign in to comment.