Skip to content

Commit

Permalink
test: remove nonsense case and correct names (#176)
Browse files Browse the repository at this point in the history
`Gemfile.lock` is nothing close to JSON, so this test doesn't make sense
- removing it does not decrease coverage either, so lets axe it.

My best guess is that it came from copying the standard set of tests
from one of the other parsers, and then not realising it since it never
failed 🤷

I also noticed two test cases were incorrectly named "json" instead of
"toml", so have corrected that too
  • Loading branch information
G-Rath committed Mar 4, 2023
1 parent a03cbc9 commit 80cd52f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pkg/lockfile/parse-cargo-lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestParseCargoLock_FileDoesNotExist(t *testing.T) {
expectPackages(t, packages, []lockfile.PackageDetails{})
}

func TestParseCargoLock_InvalidJson(t *testing.T) {
func TestParseCargoLock_InvalidToml(t *testing.T) {
t.Parallel()

packages, err := lockfile.ParseCargoLock("fixtures/cargo/not-toml.txt")
Expand Down
12 changes: 0 additions & 12 deletions pkg/lockfile/parse-gemfile-lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ func TestParseGemfileLock_FileDoesNotExist(t *testing.T) {
expectPackages(t, packages, []lockfile.PackageDetails{})
}

func TestParseGemfileLock_InvalidJson(t *testing.T) {
t.Parallel()

packages, err := lockfile.ParseGemfileLock("fixtures/bundler/not-json.txt")

if err == nil {
t.Errorf("Expected to get error, but did not")
}

expectPackages(t, packages, []lockfile.PackageDetails{})
}

func TestParseGemfileLock_NoSpecSection(t *testing.T) {
t.Parallel()

Expand Down
2 changes: 1 addition & 1 deletion pkg/lockfile/parse-poetry-lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestParsePoetryLock_FileDoesNotExist(t *testing.T) {
expectPackages(t, packages, []lockfile.PackageDetails{})
}

func TestParsePoetryLock_InvalidJson(t *testing.T) {
func TestParsePoetryLock_InvalidToml(t *testing.T) {
t.Parallel()

packages, err := lockfile.ParsePoetryLock("fixtures/poetry/not-toml.txt")
Expand Down

0 comments on commit 80cd52f

Please sign in to comment.