Files
picopackage/test/test_helper.rb
T
Dan MilneandClaude Fable 5 6dd57e84f1 Version 0.3.0: resolver/merge/cache refactor, signing design notes
- Split the monolith into package/provider/fetch/merge/cache modules with
  the Resolver deciding install/adopt/update/merge/conflict outcomes
- Three-way merges via git merge-file/diff3 against a content-addressed
  merge-base cache; conflicts go to a .picopackage-merge sibling
- Tests for package, provider, resolver, merge, and cache
- notes.md: update UX and signing design — diff-by-default, SSH signature
  identity pinning (TOFU), key changes as a hard stop, exit-code contract
- Add CLAUDE.md; remove the pre-refactor exe/pppkg monolith and scratch files

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EiyJC73Mz8xZyCTvCEY8qn
2026-08-13 21:18:19 +10:00

33 lines
994 B
Ruby

# frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../lib", __dir__)
require "picopackage"
require "minitest/autorun"
require "tmpdir"
module PicopackageTest
# Every test gets its own cache root: the merge base cache is global state and
# a suite that shared one would pass or fail depending on what ran before it.
def with_dirs
Dir.mktmpdir("picopackage-test") do |root|
upstream = File.join(root, "upstream")
project = File.join(root, "project")
[upstream, project].each { |dir| Dir.mkdir(dir) }
yield(upstream, project, Picopackage::Cache.new(root: File.join(root, "cache")))
end
end
# Stands in for a server: a real file, fetched through the real FileProvider,
# so provider metadata population is exercised rather than faked.
def publish(dir, name, content)
path = File.join(dir, name)
File.write(path, content)
path
end
def upstream_package(path)
Picopackage::FileProvider.new(path).package
end
end