Skip to content

Commit

Permalink
refactor: rename YarnLike to YarnClassicLike
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Aug 12, 2023
1 parent 3d38913 commit 3149fe3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/package_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require_relative "package_json/managers/base"
require_relative "package_json/managers/npm_like"
require_relative "package_json/managers/pnpm_like"
require_relative "package_json/managers/yarn_like"
require_relative "package_json/managers/yarn_classic_like"
require_relative "package_json/version"
require "json"

Expand Down Expand Up @@ -44,7 +44,7 @@ def new_package_manager(package_manager_name)
when :npm
PackageJson::Managers::NpmLike.new(self)
when :yarn_classic
PackageJson::Managers::YarnLike.new(self)
PackageJson::Managers::YarnClassicLike.new(self)
when :pnpm
PackageJson::Managers::PnpmLike.new(self)
else
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class PackageJson
module Managers
class YarnLike < Base
class YarnClassicLike < Base
def initialize(package_json, manager_cmd: "yarn")
super(package_json, manager_cmd: manager_cmd)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class PackageJson
module Managers
class YarnLike
class YarnClassicLike
def initialize: (PackageJson package_json, ?manager_cmd: String) -> self

def install: (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "spec_helper"

RSpec.describe PackageJson::Managers::YarnLike do
RSpec.describe PackageJson::Managers::YarnClassicLike do
subject(:manager) { described_class.new(package_json, manager_cmd: package_manager_cmd) }

let(:package_manager_cmd) { "npx yarn@1" }
Expand Down
4 changes: 2 additions & 2 deletions spec/package_json_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
with_package_json_file({ "version" => "1.0.0", "packageManager" => "[email protected]" }) do
package_json = described_class.new

expect(package_json.manager).to be_a PackageJson::Managers::YarnLike
expect(package_json.manager).to be_a PackageJson::Managers::YarnClassicLike
end
end

Expand Down Expand Up @@ -139,7 +139,7 @@
with_package_json_file({ "version" => "1.0.0" }) do
package_json = described_class.new(:yarn_classic)

expect(package_json.manager).to be_a PackageJson::Managers::YarnLike
expect(package_json.manager).to be_a PackageJson::Managers::YarnClassicLike
end
end

Expand Down

0 comments on commit 3149fe3

Please sign in to comment.