diff --git a/gradle/spec/dependabot/gradle/file_fetcher/settings_file_parser_spec.rb b/gradle/spec/dependabot/gradle/file_fetcher/settings_file_parser_spec.rb index 84b22353b3..e812b7c579 100644 --- a/gradle/spec/dependabot/gradle/file_fetcher/settings_file_parser_spec.rb +++ b/gradle/spec/dependabot/gradle/file_fetcher/settings_file_parser_spec.rb @@ -62,7 +62,7 @@ .to match_array(%w(../ganttproject ../biz.ganttproject.core)) end - context "declared across multiple lines" do + context "when the subprojects are declared across multiple lines" do let(:fixture_name) { "multiline_settings.gradle" } it "includes the additional declarations" do diff --git a/gradle/spec/dependabot/gradle/file_fetcher_spec.rb b/gradle/spec/dependabot/gradle/file_fetcher_spec.rb index f8ba3b4b5b..87d200c051 100644 --- a/gradle/spec/dependabot/gradle/file_fetcher_spec.rb +++ b/gradle/spec/dependabot/gradle/file_fetcher_spec.rb @@ -121,7 +121,7 @@ def stub_no_content_request(path) stub_content_request("buildSrc/build.gradle?ref=sha", "contents_java_basic_buildfile.json") end - context "implicitly included" do + context "when the buildSrc is implicitly included" do before do stub_content_request("?ref=sha", "contents_java_with_buildsrc.json") end @@ -144,7 +144,7 @@ def stub_no_content_request(path) end end - context "explicitly included" do + context "when the buildSrc is explicitly included" do before do stub_content_request("?ref=sha", "contents_java_with_buildsrc_and_settings.json") stub_content_request("settings.gradle?ref=sha", "contents_java_settings_explicit_buildsrc.json") @@ -252,7 +252,7 @@ def stub_no_content_request(path) end end - context "containing a script plugin" do + context "when a script plugin is present" do before do stub_content_request("?ref=sha", "contents_java_with_settings.json") stub_content_request("settings.gradle?ref=sha", "contents_java_settings_1_included_build.json") @@ -277,7 +277,7 @@ def stub_no_content_request(path) end end - context "only a settings.gradle" do + context "when only a settings.gradle is present" do before do stub_content_request("?ref=sha", "contents_java_only_settings.json") stub_content_request("app?ref=sha", "contents_java_subproject.json") @@ -361,7 +361,7 @@ def stub_no_content_request(path) end end - context "that can't be found" do + context "when the content can't be found" do before do stub_content_request("?ref=sha", "contents_java.json") stub_request( diff --git a/gradle/spec/dependabot/gradle/file_parser/property_value_finder_spec.rb b/gradle/spec/dependabot/gradle/file_parser/property_value_finder_spec.rb index 2eb811d3f9..c7e8043187 100644 --- a/gradle/spec/dependabot/gradle/file_parser/property_value_finder_spec.rb +++ b/gradle/spec/dependabot/gradle/file_parser/property_value_finder_spec.rb @@ -39,24 +39,24 @@ its([:file]) { is_expected.to eq("build.gradle") } - context "and the property name has a `project.` prefix" do + context "when the property name has a `project.` prefix" do let(:property_name) { "project.kotlin_version" } its([:value]) { is_expected.to eq("1.1.4-3") } its([:file]) { is_expected.to eq("build.gradle") } end - context "and the property name has a `rootProject.` prefix" do + context "when the property name has a `rootProject.` prefix" do let(:property_name) { "rootProject.kotlin_version" } its([:value]) { is_expected.to eq("1.1.4-3") } its([:file]) { is_expected.to eq("build.gradle") } end - context "and tricky properties" do + context "when there are tricky properties" do let(:buildfile_fixture_name) { "properties.gradle" } - context "and the property is declared with ext.name" do + context "when the property is declared with ext.name" do let(:property_name) { "kotlin_version" } its([:value]) { is_expected.to eq("1.2.61") } @@ -66,7 +66,7 @@ end end - context "and the property is declared in an ext block" do + context "when the property is declared in an ext block" do let(:property_name) { "buildToolsVersion" } its([:value]) { is_expected.to eq("27.0.3") } @@ -75,7 +75,7 @@ is_expected.to eq("buildToolsVersion = '27.0.3'") end - context "and the property name has already been set" do + context "when the property name has already been set" do let(:buildfile_fixture_name) { "duplicate_property_name.gradle" } let(:property_name) { "spek_version" } @@ -87,7 +87,7 @@ end end - context "and the property is preceded by a comment" do + context "when the property is preceded by a comment" do # This is important because the declaration string must not include # whitespace that will be different to when the FileUpdater uses it # (i.e., before the comments are stripped out) @@ -100,7 +100,7 @@ end end - context "and the property is using findProperty syntax" do + context "when the property is using findProperty syntax" do let(:property_name) { "findPropertyVersion" } its([:value]) { is_expected.to eq("27.1.1") } @@ -110,7 +110,7 @@ end end - context "and the property is using hasProperty syntax" do + context "when the property is using hasProperty syntax" do let(:property_name) { "hasPropertyVersion" } its([:value]) { is_expected.to eq("27.1.1") } @@ -122,13 +122,13 @@ end end - context "and the property is commented out" do + context "when the property is commented out" do let(:property_name) { "commentedVersion" } it { is_expected.to be_nil } end - context "and the property is declared within a namespace" do + context "when the property is declared within a namespace" do let(:buildfile_fixture_name) { "properties_namespaced.gradle" } let(:property_name) { "versions.okhttp" } @@ -138,7 +138,7 @@ is_expected.to eq("okhttp : '3.12.1'") end - context "and the property is using findProperty syntax" do + context "when the property is using findProperty syntax" do let(:property_name) { "versions.findPropertyVersion" } its([:value]) { is_expected.to eq("1.0.0") } @@ -148,7 +148,7 @@ end end - context "and the property is using hasProperty syntax" do + context "when the property is using hasProperty syntax" do let(:property_name) { "versions.hasPropertyVersion" } its([:value]) { is_expected.to eq("1.0.0") } @@ -196,14 +196,14 @@ its([:value]) { is_expected.to eq("1.1.4-3") } its([:file]) { is_expected.to eq("build.gradle") } - context "and the property name has a `project.` prefix" do + context "when the property name has a `project.` prefix" do let(:property_name) { "project.kotlin_version" } its([:value]) { is_expected.to eq("1.1.4-3") } its([:file]) { is_expected.to eq("build.gradle") } end - context "and the property name has a `rootProject.` prefix" do + context "when the property name has a `rootProject.` prefix" do let(:property_name) { "rootProject.kotlin_version" } its([:value]) { is_expected.to eq("1.1.4-3") } @@ -214,14 +214,14 @@ let(:buildfile_fixture_name) { "basic_build.gradle" } let(:callsite_fixture_name) { "single_property_build.gradle" } - context "and the property name has a `project.` prefix" do + context "when the property name has a `project.` prefix" do let(:property_name) { "project.kotlin_version" } its([:value]) { is_expected.to eq("1.1.4-3") } its([:file]) { is_expected.to eq("myapp/build.gradle") } end - context "and the property name has a `rootProject.` prefix" do + context "when the property name has a `rootProject.` prefix" do let(:property_name) { "rootProject.kotlin_version" } # We wouldn't normally expect this to be `nil` - it's more likely to @@ -234,7 +234,7 @@ let(:dependency_files) { [callsite_buildfile] } let(:callsite_fixture_name) { "single_property_build.gradle" } - context "and the property cannot be found" do + context "when the property cannot be found" do let(:property_name) { "project.NotFoundProperty" } it { is_expected.to be_nil } @@ -264,22 +264,22 @@ its([:file]) { is_expected.to eq("build.gradle.kts") } - context "and the property name has a `project.` prefix" do + context "when the property name has a `project.` prefix" do let(:property_name) { "project.kotlinVersion" } its([:value]) { is_expected.to eq("1.2.61") } its([:file]) { is_expected.to eq("build.gradle.kts") } end - context "and the property name has a `rootProject.` prefix" do + context "when the property name has a `rootProject.` prefix" do let(:property_name) { "rootProject.kotlinVersion" } its([:value]) { is_expected.to eq("1.2.61") } its([:file]) { is_expected.to eq("build.gradle.kts") } end - context "and tricky properties" do - context "and the property is declared with extra[key] = value" do + context "when there are tricky properties" do + context "when the property is declared with extra[key] = value" do let(:property_name) { "kotlinVersion" } its([:value]) { is_expected.to eq("1.2.61") } @@ -289,7 +289,7 @@ end end - context "and the property is declared with extra.set(key, value)" do + context "when the property is declared with extra.set(key, value)" do let(:property_name) { "javaVersion" } its([:value]) { is_expected.to eq("11") } @@ -299,7 +299,7 @@ end end - context "and the property is declared in an extra.apply block" do + context "when the property is declared in an extra.apply block" do let(:property_name) { "buildToolsVersion" } its([:value]) { is_expected.to eq("27.0.3") } @@ -309,7 +309,7 @@ end end - context "and the property is preceded by a comment" do + context "when the property is preceded by a comment" do # This is important because the declaration string must # not include whitespace that will be different to when # the FileUpdater uses it (i.e., before the comments @@ -323,7 +323,7 @@ end end - context "and the property is using findProperty syntax" do + context "when the property is using findProperty syntax" do let(:property_name) { "findPropertyVersion" } its([:value]) { is_expected.to eq("27.1.1") } @@ -333,7 +333,7 @@ end end - context "and the property is using hasProperty syntax" do + context "when the property is using hasProperty syntax" do let(:property_name) { "hasPropertyVersion" } its([:value]) { is_expected.to eq("27.1.1") } @@ -345,13 +345,13 @@ end end - context "and the property is commented out" do + context "when the property is commented out" do let(:property_name) { "commentedVersion" } it { is_expected.to be_nil } end - context "and the property is declared within a namespace" do + context "when the property is declared within a namespace" do let(:buildfile_fixture_name) { "root_build.gradle.kts" } let(:property_name) { "versions.okhttp" } @@ -361,7 +361,7 @@ is_expected.to eq('"okhttp" to "3.12.1"') end - context "and the property is using findProperty syntax" do + context "when the property is using findProperty syntax" do let(:property_name) { "versions.findPropertyVersion" } its([:value]) { is_expected.to eq("1.0.0") } @@ -373,7 +373,7 @@ end end - context "and the property is using hasProperty syntax" do + context "when the property is using hasProperty syntax" do let(:property_name) { "versions.hasPropertyVersion" } its([:value]) { is_expected.to eq("1.0.0") } @@ -420,14 +420,14 @@ its([:value]) { is_expected.to eq("1.2.61") } its([:file]) { is_expected.to eq("build.gradle.kts") } - context "and the property name has a `project.` prefix" do + context "when the property name has a `project.` prefix" do let(:property_name) { "project.kotlinVersion" } its([:value]) { is_expected.to eq("1.2.61") } its([:file]) { is_expected.to eq("build.gradle.kts") } end - context "and the property name has a `rootProject.` prefix" do + context "when the property name has a `rootProject.` prefix" do let(:property_name) { "rootProject.kotlinVersion" } its([:value]) { is_expected.to eq("1.2.61") } @@ -438,14 +438,14 @@ let(:buildfile_fixture_name) { "build.gradle.kts" } let(:callsite_fixture_name) { "root_build.gradle.kts" } - context "and the property name has a `project.` prefix" do + context "when the property name has a `project.` prefix" do let(:property_name) { "project.kotlinVersion" } its([:value]) { is_expected.to eq("1.2.61") } its([:file]) { is_expected.to eq("myapp/build.gradle.kts") } end - context "and the property name has a `rootProject.` prefix" do + context "when the property name has a `rootProject.` prefix" do let(:property_name) { "rootProject.kotlinVersion" } # We wouldn't normally expect this to be `nil` - it's more likely @@ -458,7 +458,7 @@ let(:dependency_files) { [callsite_buildfile] } let(:callsite_fixture_name) { "build.gradle.kts" } - context "and the property cannot be found" do + context "when the property cannot be found" do let(:property_name) { "project.NotFoundProperty" } it { is_expected.to be_nil } diff --git a/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb b/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb index a8d5b4f58c..0b48f390be 100644 --- a/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb +++ b/gradle/spec/dependabot/gradle/file_parser/repositories_finder_spec.rb @@ -66,7 +66,7 @@ end end - context "some of which are for subprojects" do + context "when there are subproject declarations" do let(:buildfile_fixture_name) { "subproject_repos.gradle" } it "doesn't include the subproject declarations" do @@ -81,7 +81,7 @@ ) end - context "and this is a subproject" do + context "when the declaration is a subproject" do let(:dependency_files) { [buildfile, subproject] } let(:target_dependency_file) { subproject } let(:subproject) do @@ -104,7 +104,7 @@ end end - context "that eval code within them" do + context "when the eval code within the declaration" do let(:buildfile_fixture_name) { "eval_repo_build.gradle" } it "ignores the repo that needs evaling" do @@ -139,7 +139,7 @@ end end - context "that get URLs from a variable" do + context "when the declaration gets URLs from a variable" do let(:buildfile_fixture_name) { "variable_repos_build.gradle" } it "includes the additional declarations" do @@ -153,7 +153,7 @@ end end - context "that use an assignment operator" do + context "when the declaration uses an assignment operator" do let(:buildfile_fixture_name) { "custom_repos_build_assignment.gradle" } it "includes the additional declarations" do @@ -166,7 +166,7 @@ end end - context "that use an assignment operator and a strict URI" do + context "when the declaration uses an assignment operator and a strict URI" do let(:buildfile_fixture_name) { "custom_repos_build_assignment_uri.gradle" } it "includes the additional declarations" do diff --git a/gradle/spec/dependabot/gradle/file_parser_spec.rb b/gradle/spec/dependabot/gradle/file_parser_spec.rb index 88911005b2..6bd0ad54dc 100644 --- a/gradle/spec/dependabot/gradle/file_parser_spec.rb +++ b/gradle/spec/dependabot/gradle/file_parser_spec.rb @@ -51,7 +51,7 @@ end end - context "specified in short form" do + context "when the build file is specified in a short form" do let(:buildfile_fixture_name) { "shortform_build.gradle" } its(:length) { is_expected.to eq(9) } @@ -206,7 +206,7 @@ its(:length) { is_expected.to eq(34) } end - context "specified in a dependencySet" do + context "when the build file is specified in a dependencySet" do let(:buildfile_fixture_name) { "dependency_set.gradle" } its(:length) { is_expected.to eq(21) } @@ -260,7 +260,7 @@ end end - context "specified as implementations" do + context "when specified as implementations" do let(:buildfile_fixture_name) { "android_build.gradle" } its(:length) { is_expected.to eq(24) } @@ -312,7 +312,7 @@ end end - context "various different specifications" do + context "when there are various different specifications in a build file" do let(:buildfile_fixture_name) { "duck_duck_go_build.gradle" } its(:length) { is_expected.to eq(37) } @@ -482,7 +482,7 @@ end end - context "specified in short form" do + context "when the build file is specified in a short form" do let(:buildfile_fixture_name) { "root_build.gradle.kts" } its(:length) { is_expected.to eq(33) } @@ -580,7 +580,7 @@ end end - context "specified in a dependencySet" do + context "when the build file is specified in a dependencySet" do let(:buildfile_fixture_name) { "root_build.gradle.kts" } its(:length) { is_expected.to eq(33) } @@ -676,7 +676,7 @@ end end - context "various different specifications" do + context "when there are various different specifications in a build file" do let(:buildfile_fixture_name) { "duck_duck_go_build.gradle.kts" } its(:length) { is_expected.to eq(37) } diff --git a/gradle/spec/dependabot/gradle/file_updater_spec.rb b/gradle/spec/dependabot/gradle/file_updater_spec.rb index 32f999c9a7..d5fb86bf07 100644 --- a/gradle/spec/dependabot/gradle/file_updater_spec.rb +++ b/gradle/spec/dependabot/gradle/file_updater_spec.rb @@ -449,7 +449,7 @@ .to include("ext.kotlin_version = '23.6-jre'") end - context "that is inherited from the parent buildfile" do + context "when the build file is inherited from the parent build file" do let(:buildfile_fixture_name) { "shortform_build.gradle" } let(:subproject_fixture_name) { "inherited_property.gradle" } diff --git a/gradle/spec/dependabot/gradle/metadata_finder_spec.rb b/gradle/spec/dependabot/gradle/metadata_finder_spec.rb index 92e32bb5c1..8572ba4a20 100644 --- a/gradle/spec/dependabot/gradle/metadata_finder_spec.rb +++ b/gradle/spec/dependabot/gradle/metadata_finder_spec.rb @@ -140,7 +140,7 @@ "parent/3.10.0/parent-3.10.0.pom" end - context "but there is in the parent" do + context "when the source url is in the parent" do before do stub_request(:get, parent_url) .to_return( @@ -156,7 +156,7 @@ expect(WebMock).to have_requested(:get, maven_url).once end - context "that doesn't match the name of the artifact" do + context "when the source url doesn't match the name of the artifact" do let(:url) { "https://api.github.com/repos/square/unrelated_name" } before do @@ -177,19 +177,19 @@ ) end - context "and doesn't have a subdirectory with its name" do + context "when the source url doesn't have a subdirectory with its name" do let(:repo_contents_fixture_nm) { "contents_js_npm.json" } it { is_expected.to be_nil } end - context "and does have a subdirectory with its name" do + context "when the source url have a subdirectory with its name" do let(:repo_contents_fixture_nm) { "contents_java.json" } it { is_expected.to eq("https://github.com/square/unrelated_name") } end - context "and the repo 404s" do + context "when the request to repo returns a 404 status" do before do allow_any_instance_of(Dependabot::FileFetchers::Base) .to receive(:commit).and_call_original @@ -209,7 +209,7 @@ end end - context "and there isn't in the parent, either" do + context "when there is no github link in the parent, either" do before do stub_request(:get, parent_url).to_return(status: 404, body: "") end @@ -228,7 +228,7 @@ it { is_expected.to eq("https://github.com/davidB/maven-scala-plugin") } - context "that is nested" do + context "when the source url is nested" do let(:maven_response) do fixture("poms", "nested_property_url_pom.xml") end @@ -239,7 +239,7 @@ end end - context "when using a custom registry" do + context "when the dependency uses a custom registry" do let(:dependency_source) do { type: "maven_repo", url: "https://custom.registry.org/maven2" } end @@ -271,7 +271,7 @@ it { is_expected.to eq("https://github.com/mockito/mockito") } - context "that include a username and password" do + context "when the credentials includes a username and password" do let(:credentials) do [ { @@ -345,7 +345,7 @@ it { is_expected.to eq("https://github.com/mockito/mockito") } - context "that include a username and password" do + context "when the credentials includes a username and password" do let(:credentials) do [ { diff --git a/gradle/spec/dependabot/gradle/requirement_spec.rb b/gradle/spec/dependabot/gradle/requirement_spec.rb index 94eac435fb..8287a7ef80 100644 --- a/gradle/spec/dependabot/gradle/requirement_spec.rb +++ b/gradle/spec/dependabot/gradle/requirement_spec.rb @@ -34,19 +34,19 @@ it { is_expected.to eq(Gem::Requirement.new(">= 1.0.0")) } - context "which needs a > operator" do + context "when the requirement needs a > operator" do let(:requirement_string) { "(1.0.0,)" } it { is_expected.to eq(Gem::Requirement.new("> 1.0.0")) } end - context "which needs a > and a < operator" do + context "when the requirement needs a > and a < operator" do let(:requirement_string) { "(1.0.0, 2.0.0)" } it { is_expected.to eq(Gem::Requirement.new("> 1.0.0", "< 2.0.0")) } end - context "which needs a >= and a <= operator" do + context "when the requirement needs a >= and a <= operator" do let(:requirement_string) { "[ 1.0.0,2.0.0 ]" } it { is_expected.to eq(Gem::Requirement.new(">= 1.0.0", "<= 2.0.0")) } @@ -64,13 +64,13 @@ its(:to_s) { is_expected.to eq(Gem::Requirement.new("~> 1.0").to_s) } - context "that specifies a minimum" do + context "when specifying a minimum version in the requirement" do let(:requirement_string) { "1.5+" } its(:to_s) { is_expected.to eq(Gem::Requirement.new("~> 1.5").to_s) } end - context "that is just a +" do + context "when the requirement is just a +" do let(:requirement_string) { "+" } its(:to_s) { is_expected.to eq(Gem::Requirement.new(">= 0").to_s) } @@ -141,7 +141,7 @@ subject { requirement.satisfied_by?(version) } context "with a Gem::Version" do - context "for the current version" do + context "when using the current version" do let(:version) { Gem::Version.new("1.0.0") } it { is_expected.to be(true) } @@ -153,7 +153,7 @@ end end - context "for an out-of-range version" do + context "when using an out-of-range version" do let(:version) { Gem::Version.new("0.9.0") } it { is_expected.to be(false) } @@ -165,25 +165,25 @@ Dependabot::Gradle::Version.new(version_string) end - context "for the current version" do + context "when using the current version" do let(:version_string) { "1.0.0" } it { is_expected.to be(true) } - context "for a post-release version" do + context "when using a post-release version" do let(:version_string) { "1.0.0u2" } it { is_expected.to be(true) } end - context "for a pre-release string" do + context "when using a pre-release string" do let(:requirement_string) { "1.0.0-alpha" } it { is_expected.to be(false) } end end - context "for an out-of-range version" do + context "when using an out-of-range version" do let(:version_string) { "0.9.0" } it { is_expected.to be(false) } diff --git a/gradle/spec/dependabot/gradle/update_checker/requirements_updater_spec.rb b/gradle/spec/dependabot/gradle/update_checker/requirements_updater_spec.rb index f571a47178..c17c050f4e 100644 --- a/gradle/spec/dependabot/gradle/update_checker/requirements_updater_spec.rb +++ b/gradle/spec/dependabot/gradle/update_checker/requirements_updater_spec.rb @@ -42,25 +42,25 @@ context "when there is a latest version" do let(:latest_version) { version_class.new("23.6-jre") } - context "and no requirement was previously specified" do + context "when no requirement was previously specified" do let(:pom_req_string) { nil } it { is_expected.to eq(pom_req) } end - context "and a LATEST requirement was previously specified" do + context "when a LATEST requirement was previously specified" do let(:pom_req_string) { "LATEST" } its([:requirement]) { is_expected.to eq("23.6-jre") } end - context "and a soft requirement was previously specified" do + context "when a soft requirement was previously specified" do let(:pom_req_string) { "23.3-jre" } its([:requirement]) { is_expected.to eq("23.6-jre") } its([:source]) { is_expected.to eq(type: "maven_repo", url: "new_url") } - context "that include multiple dashes" do + context "when the requirement includes multiple dashes" do let(:pom_req_string) { "v2-rev398-1.24.1" } let(:latest_version) { version_class.new("v2-rev404-1.25.0") } @@ -68,37 +68,37 @@ end end - context "and the version included capitals" do + context "when the requirement includes uppercase letters" do let(:pom_req_string) { "23.3.RELEASE" } its([:requirement]) { is_expected.to eq("23.6-jre") } end - context "and a hard requirement was previously specified" do + context "when a hard requirement was previously specified" do let(:pom_req_string) { "[23.3-jre]" } its([:requirement]) { is_expected.to eq("[23.6-jre]") } end - context "and a dynamic requirement was previously specified" do + context "when a dynamic requirement was previously specified" do let(:pom_req_string) { "22.+" } its([:requirement]) { is_expected.to eq("23.+") } - context "that omits the dot before the plus" do + context "when the requirement omits the dot before the plus" do let(:pom_req_string) { "22.1+" } its([:requirement]) { is_expected.to eq("23.6+") } end - context "that is just a plus" do + context "when the requirement is just a plus" do let(:pom_req_string) { "+" } its([:requirement]) { is_expected.to eq("+") } end end - context "and there were multiple requirements" do + context "when there are multiple requirements" do let(:requirements) { [pom_req, other_pom_req] } let(:other_pom_req) do @@ -128,7 +128,7 @@ ) end - context "and one is a range requirement" do + context "when one is a range requirement" do let(:other_requirement_string) { "[23.0,)" } it "updates only the specific requirement" do diff --git a/gradle/spec/dependabot/gradle/update_checker/version_finder_spec.rb b/gradle/spec/dependabot/gradle/update_checker/version_finder_spec.rb index 3bdf86f618..648cbcdb88 100644 --- a/gradle/spec/dependabot/gradle/update_checker/version_finder_spec.rb +++ b/gradle/spec/dependabot/gradle/update_checker/version_finder_spec.rb @@ -84,7 +84,7 @@ its([:version]) { is_expected.to eq(version_class.new("3.2.2")) } - context "and that's what we're using" do + context "when that's what we're using" do let(:dependency_version) { "20030418" } its([:version]) { is_expected.to eq(version_class.new("20040616")) } @@ -104,7 +104,7 @@ its([:version]) { is_expected.to eq(version_class.new("1.4.12-java7")) } - context "and the type is native-mt" do + context "when the type is native-mt" do let(:dependency_version) { "1.4.11-native-mt" } its([:version]) do @@ -129,7 +129,7 @@ its([:version]) { is_expected.to eq(version_class.new("1.4.12")) } end - context "raise_on_ignored when later versions are allowed" do + context "when raise_on_ignored is enabled and later versions are allowed" do let(:raise_on_ignored) { true } it "doesn't raise an error" do @@ -140,7 +140,7 @@ context "when already on the latest version" do its([:version]) { is_expected.to eq(version_class.new("23.6-jre")) } - context "raise_on_ignored" do + context "when raise_on_ignored is enabled" do let(:raise_on_ignored) { true } it "doesn't raise an error" do @@ -162,7 +162,7 @@ its([:version]) { is_expected.to eq(version_class.new("22.0")) } - context "raise_on_ignored" do + context "when raise_on_ignored is enabled" do let(:raise_on_ignored) { true } it "raises an error" do @@ -200,7 +200,7 @@ expect(latest_version_details).to be_nil end - context "raise_on_ignored" do + context "when raise_on_ignored is enabled" do let(:raise_on_ignored) { true } it "raises an error" do @@ -212,7 +212,7 @@ context "when the dependency version isn't known" do let(:dependency_version) { nil } - context "raise_on_ignored" do + context "when raise_on_ignored is enabled" do let(:raise_on_ignored) { true } it "doesn't raise an error" do @@ -295,7 +295,7 @@ is_expected.to eq("https://private.registry.org/repo") end - context "that is a gitlab maven repository" do + context "when it is a gitlab maven repository" do let(:credentials) do [ { @@ -331,7 +331,7 @@ end end - context "but no auth details" do + context "when there is no auth details" do let(:credentials) do [{ "type" => "maven_repository", @@ -495,7 +495,7 @@ end end - context "no auth details" do + context "when there is no auth details" do let(:credentials) do [{ "type" => "maven_repository", diff --git a/gradle/spec/dependabot/gradle/update_checker_spec.rb b/gradle/spec/dependabot/gradle/update_checker_spec.rb index 2e3bd84b0c..1b16261ac8 100644 --- a/gradle/spec/dependabot/gradle/update_checker_spec.rb +++ b/gradle/spec/dependabot/gradle/update_checker_spec.rb @@ -87,7 +87,7 @@ it { is_expected.to eq(version_class.new("3.2.2")) } - context "and that's what we're using" do + context "when that's what we're using" do let(:dependency_version) { "20030418" } it { is_expected.to eq(version_class.new("20040616")) } @@ -120,7 +120,7 @@ it { is_expected.to eq(version_class.new("23.0")) } - context "that affects multiple dependencies" do + context "when the version affects multiple dependencies" do let(:buildfile_fixture_name) { "shortform_build.gradle" } it { is_expected.to eq(version_class.new("23.0")) } @@ -219,7 +219,7 @@ it { is_expected.to eq(version_class.new("23.0")) } - context "that affects multiple dependencies" do + context "when the version affects multiple dependencies" do let(:buildfile_fixture_name) { "shortform_build.gradle" } it { is_expected.to be_nil } diff --git a/gradle/spec/dependabot/gradle/version_spec.rb b/gradle/spec/dependabot/gradle/version_spec.rb index fe9a30b98d..6f6207de11 100644 --- a/gradle/spec/dependabot/gradle/version_spec.rb +++ b/gradle/spec/dependabot/gradle/version_spec.rb @@ -126,45 +126,45 @@ describe "#<=>" do subject { version.send(:<=>, other_version) } - context "compared to a Gem::Version" do - context "that is lower" do + context "when comparing to a Gem::Version" do + context "when the other version is lower" do let(:other_version) { Gem::Version.new("0.9.0") } it { is_expected.to eq(1) } end - context "that is equal" do + context "when the other version is equal" do let(:other_version) { Gem::Version.new("1.0.0") } it { is_expected.to eq(0) } end - context "that is greater" do + context "when the other version is greater" do let(:other_version) { Gem::Version.new("1.1.0") } it { is_expected.to eq(-1) } end end - context "compared to a Gradle::Version" do - context "that is lower" do + context "when comparing to a Gradle::Version" do + context "when the other version is lower" do let(:other_version) { described_class.new("0.9.0") } it { is_expected.to eq(1) } end - context "that is equal" do + context "when the other version is equal" do let(:other_version) { described_class.new("1.0.0") } it { is_expected.to eq(0) } - context "but prefixed with a v" do + context "when the other version is prefixed with a v" do let(:other_version) { described_class.new("v1.0.0") } it { is_expected.to eq(0) } end - context "using different date formats" do + context "when the other version uses different date formats" do let(:version_string) { "20181003" } let(:other_version) { described_class.new("v2018-10-03") } @@ -172,25 +172,25 @@ end end - context "that is greater" do + context "when the other version is greater" do let(:other_version) { described_class.new("1.1.0") } it { is_expected.to eq(-1) } end - context "that is a post-release" do + context "when the other version is a post-release" do let(:other_version) { described_class.new("1.0.0u1") } it { is_expected.to eq(-1) } end - context "that is a pre-release" do + context "when the other version is a pre-release" do let(:other_version) { described_class.new("1.0.0a1") } it { is_expected.to eq(1) } end - context "that is non-numeric" do + context "when the other version is non-numeric" do let(:version) { described_class.new("Finchley") } let(:other_version) { described_class.new("Edgware") } @@ -198,154 +198,154 @@ end describe "from the spec" do - context "number padding" do + context "when using number padding" do let(:version) { described_class.new("1") } let(:other_version) { described_class.new("1.1") } it { is_expected.to eq(-1) } end - context "qualifier padding" do + context "when using qualifier padding" do let(:version) { described_class.new("1-snapshot") } let(:other_version) { described_class.new("1") } it { is_expected.to eq(-1) } end - context "qualifier padding 1" do + context "when using qualifier padding 1" do let(:version) { described_class.new("1") } let(:other_version) { described_class.new("1-sp") } it { is_expected.to eq(-1) } end - context "switching" do + context "when using switching" do let(:version) { described_class.new("1-foo2") } let(:other_version) { described_class.new("1-foo10") } it { is_expected.to eq(-1) } end - context "prefixes" do + context "when using prefixes" do let(:version) { described_class.new("1.foo") } let(:other_version) { described_class.new("1-foo") } it { is_expected.to eq(-1) } end - context "prefixes2" do + context "when using prefixes2" do let(:version) { described_class.new("1-foo") } let(:other_version) { described_class.new("1-1") } it { is_expected.to eq(-1) } end - context "prefixes3" do + context "when using prefixes3" do let(:version) { described_class.new("1-1") } let(:other_version) { described_class.new("1.1") } it { is_expected.to eq(-1) } end - context "null values" do + context "when using null values" do let(:version) { described_class.new("1.ga") } let(:other_version) { described_class.new("1-ga") } it { is_expected.to eq(0) } end - context "null values 2" do + context "when using null values 2" do let(:version) { described_class.new("1-ga") } let(:other_version) { described_class.new("1-0") } it { is_expected.to eq(0) } end - context "null values 3" do + context "when using null values 3" do let(:version) { described_class.new("1-0") } let(:other_version) { described_class.new("1.0") } it { is_expected.to eq(0) } end - context "null values 4" do + context "when using null values 4" do let(:version) { described_class.new("1.0") } let(:other_version) { described_class.new("1") } it { is_expected.to eq(0) } end - context "null values 5" do + context "when using null values 5" do let(:version) { described_class.new("1.0.") } let(:other_version) { described_class.new("1") } it { is_expected.to eq(0) } end - context "null values 6" do + context "when using null values 6" do let(:version) { described_class.new("1.0-.2") } let(:other_version) { described_class.new("1.0-0.2") } it { is_expected.to eq(0) } end - context "case insensitivity" do + context "when using case insensitivity" do let(:version) { described_class.new("1.0.FINAL") } let(:other_version) { described_class.new("1") } it { is_expected.to eq(0) } end - context "case insensitivity 2" do + context "when using case insensitivity 2" do let(:version) { described_class.new("1.something") } let(:other_version) { described_class.new("1.SOMETHING") } it { is_expected.to eq(0) } end - context "post releases" do + context "when using post releases" do let(:version) { described_class.new("1-sp") } let(:other_version) { described_class.new("1-ga") } it { is_expected.to eq(1) } end - context "post releases 2" do + context "when using post releases 2" do let(:version) { described_class.new("1-sp.1") } let(:other_version) { described_class.new("1-ga.1") } it { is_expected.to eq(1) } end - context "numeric token after underscore" do + context "when using a numeric token after underscore" do let(:version) { described_class.new("1.0.0_100") } let(:other_version) { described_class.new("1.0.0_99") } it { is_expected.to eq(1) } end - context "null values (again)" do + context "when using null values (again)" do let(:version) { described_class.new("1-sp-1") } let(:other_version) { described_class.new("1-ga-1") } it { is_expected.to eq(-1) } end - context "null values (again 2)" do + context "when using null values (again 2)" do let(:version) { described_class.new("1-ga-1") } let(:other_version) { described_class.new("1-1") } it { is_expected.to eq(0) } end - context "named values" do + context "when using named values" do let(:version) { described_class.new("1-a1") } let(:other_version) { described_class.new("1-alpha-1") } it { is_expected.to eq(0) } end - context "dynamic minor version" do + context "when using dynamic minor version" do let(:version) { described_class.new("1.+") } it "is greater than a non-dynamic version" do @@ -358,7 +358,7 @@ end end - context "dynamic patch version" do + context "when using dynamic patch version" do let(:version) { described_class.new("1.1.+") } it "is greater than a non-dynamic version" do