Parts-Based Manifest Publishing
This commit is contained in:
@@ -6,34 +6,6 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestTopDataAssetsDirDiscoversSiblingRepo(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
mkdirAll(t, filepath.Join(root, "assets"))
|
||||
mkdirAll(t, filepath.Join(root, "build"))
|
||||
|
||||
parentDir := filepath.Dir(root)
|
||||
siblingPath := filepath.Join(parentDir, "sow-assets")
|
||||
mkdirAll(t, siblingPath)
|
||||
mkdirAll(t, filepath.Join(siblingPath, "assets", "part", "belt"))
|
||||
|
||||
proj := &Project{
|
||||
Root: root,
|
||||
Config: Config{
|
||||
Module: ModuleConfig{Name: "Test", ResRef: "test"},
|
||||
Paths: PathConfig{Source: "src", Assets: "assets", Build: "build"},
|
||||
TopData: TopDataConfig{
|
||||
Assets: "sow-assets",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
result := proj.TopDataAssetsDir()
|
||||
if result != siblingPath {
|
||||
t.Errorf("expected %s, got %s", siblingPath, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTopDataAssetsDirPrefersExplicitConfig(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
@@ -59,6 +31,35 @@ func TestTopDataAssetsDirPrefersExplicitConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTopDataAssetsDirDoesNotAssumeSiblingRepo(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
mkdirAll(t, filepath.Join(root, "assets"))
|
||||
mkdirAll(t, filepath.Join(root, "build"))
|
||||
|
||||
parentDir := filepath.Dir(root)
|
||||
siblingPath := filepath.Join(parentDir, "sow-assets")
|
||||
mkdirAll(t, siblingPath)
|
||||
mkdirAll(t, filepath.Join(siblingPath, "assets", "part", "belt"))
|
||||
|
||||
proj := &Project{
|
||||
Root: root,
|
||||
Config: Config{
|
||||
Module: ModuleConfig{Name: "Test", ResRef: "test"},
|
||||
Paths: PathConfig{Source: "src", Assets: "assets", Build: "build"},
|
||||
TopData: TopDataConfig{
|
||||
Assets: "sow-assets",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
result := proj.TopDataAssetsDir()
|
||||
expected := filepath.Join(root, "sow-assets")
|
||||
if result != expected {
|
||||
t.Errorf("expected unresolved local path %s, got %s", expected, result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTopDataAssetsDirReturnsEmptyForNoConfig(t *testing.T) {
|
||||
root := t.TempDir()
|
||||
mkdirAll(t, filepath.Join(root, "src"))
|
||||
|
||||
Reference in New Issue
Block a user