Migrate acquisition fixtures to document-root controls
This commit is contained in:
@@ -64,7 +64,7 @@ func TestLayeredDestinationDiagnosticsUseEffectivePathsAndAuthoredLocations(t *t
|
||||
t.Run("imported version failure uses effective path and import source", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
directory := t.TempDir()
|
||||
writeImportFile(t, directory, "main.yml", "configkit: {imports: [{path: fragment.yml}]}\n")
|
||||
writeImportFile(t, directory, "main.yml", "config: {imports: [{path: fragment.yml}]}\n")
|
||||
writeImportFile(t, directory, "fragment.yml", "version: forbidden\n")
|
||||
rule := &VersionRule{Path: Keys("application", "version"), Check: func(Version, *Validation) error { return nil }}
|
||||
loaded, err := LoadLayered(
|
||||
@@ -108,7 +108,7 @@ func TestLayeredDestinationDiagnosticsUseEffectivePathsAndAuthoredLocations(t *t
|
||||
t.Run("malformed source directive keeps its local path and location", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
filesystem := NewFilesystem("bundle", fstest.MapFS{
|
||||
"main.yml": &fstest.MapFile{Data: []byte("configkit: {imports: [true]}\nvalue: present\n")},
|
||||
"main.yml": &fstest.MapFile{Data: []byte("config: {imports: [true]}\nvalue: present\n")},
|
||||
})
|
||||
loaded, err := LoadLayered(
|
||||
Input{Source: filesystem.File("main.yml"), Imports: true, Destination: Keys("application")},
|
||||
@@ -119,7 +119,7 @@ func TestLayeredDestinationDiagnosticsUseEffectivePathsAndAuthoredLocations(t *t
|
||||
t.Fatalf("malformed directive returned a result: %#v", loaded)
|
||||
}
|
||||
diagnostic := firstDestinationDiagnostic(t, err)
|
||||
if diagnostic.Code != CodeImportInvalid || diagnostic.Path.String() != "/configkit/imports/0" {
|
||||
if diagnostic.Code != CodeImportInvalid || diagnostic.Path.String() != "/config/imports/0" {
|
||||
t.Fatalf("malformed directive diagnostic = %#v", diagnostic)
|
||||
}
|
||||
if diagnostic.Primary == nil || diagnostic.Primary.SourceID != "source-1" || diagnostic.Primary.Line != 1 {
|
||||
|
||||
Reference in New Issue
Block a user