Skip to content

Commit

Permalink
Un-nest contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
landongrindheim committed Mar 8, 2023
1 parent ef741db commit 3cdc3b9
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions updater/spec/dependabot/updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1604,9 +1604,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "when an error is raised" do
context "during parsing" do
context "and it's an unknown error" do
context "when an unknown error is raised during parsing" do
it "tells Sentry" do
checker = stub_update_checker
error = StandardError.new("hell")
Expand Down Expand Up @@ -1646,9 +1644,8 @@ def expect_update_checker_with_ignored_versions(versions)

updater.run
end
end

context "but it's a Dependabot::DependencyFileNotFound" do
context "when Dependabot::DependencyFileNotFound is raised during parsing" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::DependencyFileNotFound.new("path/to/file")
Expand Down Expand Up @@ -1688,9 +1685,9 @@ def expect_update_checker_with_ignored_versions(versions)

updater.run
end
end
end

context "but it's a Dependabot::BranchNotFound" do
context "when Dependabot::BranchNotFound is raised during parsing" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::BranchNotFound.new("my_branch")
Expand Down Expand Up @@ -1730,9 +1727,9 @@ def expect_update_checker_with_ignored_versions(versions)

updater.run
end
end
end

context "but it's a Dependabot::DependencyFileNotParseable" do
context "when Dependabot::DependencyFileNotParseable is raised during parsing" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::DependencyFileNotParseable.new("path/to/file", "a")
Expand Down Expand Up @@ -1772,9 +1769,9 @@ def expect_update_checker_with_ignored_versions(versions)

updater.run
end
end
end

context "but it's a Dependabot::PathDependenciesNotReachable" do
context "when Dependabot::PathDependenciesNotReachable is raised during parsing" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::PathDependenciesNotReachable.new(["bad_gem"])
Expand Down Expand Up @@ -1814,10 +1811,9 @@ def expect_update_checker_with_ignored_versions(versions)

updater.run
end
end
end

context "but it's a Dependabot::DependencyFileNotResolvable" do
context "when Dependabot::DependencyFileNotResolvable is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::DependencyFileNotResolvable.new("message")
Expand Down Expand Up @@ -1855,7 +1851,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::DependencyFileNotEvaluatable" do
context "when Dependabot::DependencyFileNotEvaluatable is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::DependencyFileNotEvaluatable.new("message")
Expand Down Expand Up @@ -1893,7 +1889,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::InconsistentRegistryResponse" do
context "when Dependabot::InconsistentRegistryResponse is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::InconsistentRegistryResponse.new("message")
Expand Down Expand Up @@ -1925,7 +1921,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::GitDependenciesNotReachable" do
context "when Dependabot::GitDependenciesNotReachable is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::GitDependenciesNotReachable.new("https://example.com")
Expand Down Expand Up @@ -1963,7 +1959,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::GitDependencyReferenceNotFound" do
context "when Dependabot::GitDependencyReferenceNotFound is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::GitDependencyReferenceNotFound.new("some_dep")
Expand Down Expand Up @@ -2001,7 +1997,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::GoModulePathMismatch" do
context "when Dependabot::GoModulePathMismatch is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::GoModulePathMismatch.new("/go.mod", "foo", "bar")
Expand Down Expand Up @@ -2043,7 +2039,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::PrivateSourceAuthenticationFailure" do
context "when Dependabot::PrivateSourceAuthenticationFailure is raised" do
it "doesn't tell Sentry" do
checker = stub_update_checker
error = Dependabot::PrivateSourceAuthenticationFailure.new("some.example.com")
Expand Down Expand Up @@ -2081,7 +2077,7 @@ def expect_update_checker_with_ignored_versions(versions)
end
end

context "but it's a Dependabot::SharedHelpers::HelperSubprocessFailed" do
context "when Dependabot::SharedHelpers::HelperSubprocessFailed is raised" do
it "tells the main backend there has been an unknown error" do
checker = stub_update_checker
error =
Expand Down

0 comments on commit 3cdc3b9

Please sign in to comment.