Skip to content

Commit

Permalink
TICtxtWrd-pub: Test Improvements, Context Wording, Ecosystem pub. (#9840
Browse files Browse the repository at this point in the history
)

Co-authored-by: “Thavachelvam <“thavaahariharangit@git.com”>
  • Loading branch information
thavaahariharangit and “Thavachelvam authored May 28, 2024
1 parent c25bc8d commit 7cef3aa
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 35 deletions.
1 change: 0 additions & 1 deletion .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ RSpec/ContextWording:
- 'maven/**/*'
- 'npm_and_yarn/**/*'
- 'nuget/**/*'
- 'pub/**/*'
- 'python/**/*'
- 'sorbet/**/*'
- 'terraform/**/*'
Expand Down
4 changes: 2 additions & 2 deletions pub/spec/dependabot/pub/file_fetcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
end
end

context "mono-repo" do
context "when dealing with a mono-repo" do
let(:project_name) { "mono_repo" }
let(:directory) { "/main" }

Expand All @@ -45,7 +45,7 @@
end
end

context "mono-repo, no pubspec.lock" do
context "when dealing with a mono-repo with no pubspec.lock" do
let(:project_name) { "no_lockfile" }
let(:directory) { "/main" }

Expand Down
4 changes: 2 additions & 2 deletions pub/spec/dependabot/pub/requirements_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
end

context "with a caret version" do
context "specified to version" do
context "when specified to version" do
let(:requirement_string) { "^1.2.3" }

d = described_class.new(">=1.2.3", "<2.0.0")
Expand All @@ -53,7 +53,7 @@

it { is_expected.to eq(described_class.new(">= 0.2.3", "< 0.3.0")) }

context "and a zero minor" do
context "when dealing with a zero minor" do
let(:requirement_string) { "^0.0.3" }

it { is_expected.to eq(described_class.new(">= 0.0.3", "< 0.0.4")) }
Expand Down
60 changes: 30 additions & 30 deletions pub/spec/dependabot/pub/update_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@
checker.updated_dependencies(requirements_to_unlock: requirements_to_unlock).map(&:to_h)
end

context "given an outdated dependency, not requiring unlock" do
context "when given an outdated dependency, not requiring unlock" do
let(:dependency_name) { "collection" }

context "unlocking all" do
context "when unlocking all" do
let(:requirements_to_unlock) { :all }

it "can update" do
Expand All @@ -133,11 +133,11 @@
end
end

context "unlocking own" do
context "when unlocking own" do
let(:requirements_to_unlock) { :own }

context "with auto-strategy" do
context "app (no version)" do
context "when dealing with an app (no version)" do
it "can update" do
expect(can_update).to be_truthy
expect(updated_dependencies).to eq [
Expand All @@ -154,7 +154,7 @@
end
end

context "library (has version)" do
context "when dealing with a library (has version)" do
let(:project) { "can_update_library" }

it "can update" do
Expand Down Expand Up @@ -233,7 +233,7 @@
end
end

context "unlocking none" do
context "when unlocking none" do
let(:requirements_to_unlock) { :none }

it "can update" do
Expand All @@ -250,7 +250,7 @@
end
end

context "will not upgrade to ignored version" do
context "when not upgrading to ignored version" do
let(:requirements_to_unlock) { :none }
let(:ignored_versions) { ["1.16.0"] }

Expand All @@ -260,14 +260,14 @@
end
end

context "given an outdated dependency, requiring unlock" do
context "when given an outdated dependency, requiring unlock" do
let(:dependency_name) { "retry" }

context "unlocking all" do
context "when unlocking all" do
let(:requirements_to_unlock) { :all }

context "with auto-strategy" do
context "app (no version)" do
context "when dealing with an app (no version)" do
it "can update" do
expect(can_update).to be_truthy
expect(updated_dependencies).to eq [
Expand All @@ -285,7 +285,7 @@
end
end

context "app (version but publish_to: none)" do
context "when dealing with an app (version but publish_to: none)" do
let(:project) { "can_update_publish_to_none" }

it "can update" do
Expand All @@ -305,7 +305,7 @@
end
end

context "library (has version)" do
context "when dealing with a library (has version)" do
let(:project) { "can_update_library" }

it "can update" do
Expand Down Expand Up @@ -387,7 +387,7 @@
end
end

context "unlocking own" do
context "when unlocking own" do
let(:requirements_to_unlock) { :own }

it "can update" do
Expand All @@ -405,7 +405,7 @@
end
end

context "will not upgrade to ignored version" do
context "when not upgrading to ignored version" do
let(:requirements_to_unlock) { :own }
let(:ignored_versions) { ["3.1.0"] }

Expand All @@ -416,7 +416,7 @@
end
end

context "unlocking none" do
context "when unlocking none" do
let(:requirements_to_unlock) { :none }

it "can update" do
Expand All @@ -425,10 +425,10 @@
end
end

context "given an outdated dependency, requiring full unlock" do
context "when given an outdated dependency, requiring full unlock" do
let(:dependency_name) { "protobuf" }

context "unlocking all" do
context "when unlocking all" do
let(:requirements_to_unlock) { :all }

it "can update" do
Expand Down Expand Up @@ -469,15 +469,15 @@
end
end

context "unlocking own" do
context "when unlocking own" do
let(:requirements_to_unlock) { :own }

it "can update" do
expect(can_update).to be_falsey
end
end

context "unlocking none" do
context "when unlocking none" do
let(:requirements_to_unlock) { :none }

it "can update" do
Expand All @@ -486,26 +486,26 @@
end
end

context "given an up-to-date dependency" do
context "when given an up-to-date dependency" do
let(:dependency_name) { "path" }

context "unlocking all" do
context "when unlocking all" do
let(:requirements_to_unlock) { :all }

it "can update" do
expect(can_update).to be_falsey
end
end

context "unlocking own" do
context "when unlocking own" do
let(:requirements_to_unlock) { :own }

it "can update" do
expect(can_update).to be_falsey
end
end

context "unlocking none" do
context "when unlocking none" do
let(:requirements_to_unlock) { :none }

it "can update" do
Expand Down Expand Up @@ -546,7 +546,7 @@
end
end

context "Can unlock transitive deps" do
context "when transitive deps can be unlocked" do
let(:requirements_to_unlock) { :all }
let(:dependency_name) { "protobuf" }
let(:dependency_version) { "1.1.4" }
Expand Down Expand Up @@ -655,11 +655,11 @@
end
end

context "mono repo" do
context "when dealing with mono repo" do
let(:project) { "mono_repo_main_at_root" }
let(:dependency_name) { "dep" }

context "unlocking none" do
context "when unlocking none" do
let(:requirements_to_unlock) { :none }

it "can update" do
Expand Down Expand Up @@ -714,7 +714,7 @@
end
end

context "With a git dependency" do
context "with a git dependency" do
include_context :uses_temp_dir

let(:project) { "git_dependency" }
Expand Down Expand Up @@ -789,7 +789,7 @@
end
end

context "works for a flutter project" do
context "when working for a flutter project" do
include_context :uses_temp_dir

let(:project) { "requires_flutter" }
Expand All @@ -813,7 +813,7 @@
end
end

context "works for a flutter project requiring a flutter beta" do
context "when working for a flutter project requiring a flutter beta" do
include_context :uses_temp_dir

let(:project) { "requires_latest_beta" }
Expand All @@ -837,7 +837,7 @@
end
end

context "loads a YAML file with alias" do
context "when loading a YAML file with alias" do
fixture = "spec/fixtures/projects/yaml_alias/"
alias_info_file = "pubspec_alias_true.yaml"
non_alias_info_file = "pubspec.yaml"
Expand Down

0 comments on commit 7cef3aa

Please sign in to comment.