Skip to content

Commit c2f10d6

Browse files
committed
file: fix legacy tests
1 parent 1c1c7ac commit c2f10d6

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

file_test.go

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,30 +266,29 @@ VERSION = v1`))
266266
assert.Equal(t, "v1", f.Section("").Key("version").String())
267267
})
268268

269-
Convey("Get section after deletion", t, func() {
270-
f, err := ini.Load([]byte(`
269+
t.Run("get sections after deletion", func(t *testing.T) {
270+
f, err := Load([]byte(`
271271
[RANDOM]
272272
`))
273-
So(f, ShouldNotBeNil)
274-
So(err, ShouldBeNil)
273+
require.NoError(t, err)
274+
require.NotNil(t, f)
275+
275276
sectionNames := f.SectionStrings()
276277
sort.Strings(sectionNames)
277-
So(sectionNames, ShouldResemble, []string{ini.DefaultSection, "RANDOM"})
278+
assert.Equal(t, []string{DefaultSection, "RANDOM"}, sectionNames)
278279

279280
for _, currentSection := range sectionNames {
280281
f.DeleteSection(currentSection)
281282
}
282-
Convey("Section recreated", func() {
283-
for sectionParam, expectedSectionName := range map[string]string{
284-
"": ini.DefaultSection,
285-
"RANDOM": "RANDOM",
286-
} {
287-
sec := f.Section(sectionParam)
288-
So(sec, ShouldNotBeNil)
289-
So(sec.Name(), ShouldEqual, expectedSectionName)
290-
}
291-
})
292283

284+
for sectionParam, expectedSectionName := range map[string]string{
285+
"": DefaultSection,
286+
"RANDOM": "RANDOM",
287+
} {
288+
sec := f.Section(sectionParam)
289+
require.NotNil(t, sec)
290+
assert.Equal(t, expectedSectionName, sec.Name())
291+
}
293292
})
294293

295294
}

0 commit comments

Comments
 (0)