Skip to content

Commit

Permalink
update min. shakapacker version to 7.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adriangohjw committed May 21, 2024
1 parent 548c0a2 commit c891201
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/react_on_rails/packs_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module ReactOnRails
# rubocop:disable Metrics/ClassLength
class PacksGenerator
CONTAINS_CLIENT_OR_SERVER_REGEX = /\.(server|client)($|\.)/
MINIMUM_SHAKAPACKER_VERSION = [6, 5, 1].freeze
MINIMUM_SHAKAPACKER_VERSION = [7, 2, 1].freeze

def self.instance
@instance ||= PacksGenerator.new
Expand Down
17 changes: 8 additions & 9 deletions spec/react_on_rails/shakapacker_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,32 @@ module ReactOnRails
end

describe ".shackapacker_version_requirement_met?" do
minimum_version = [6, 5, 3]
minimum_version = [7, 2, 1]

it "returns false when version is lower than minimum_version" do
allow(described_class).to receive(:shakapacker_version).and_return("6.5.0")

allow(described_class).to receive(:shakapacker_version).and_return("7.2.0")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(false)

allow(described_class).to receive(:shakapacker_version).and_return("6.4.7")
allow(described_class).to receive(:shakapacker_version).and_return("7.1.0")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(false)

allow(described_class).to receive(:shakapacker_version).and_return("5.7.7")
allow(described_class).to receive(:shakapacker_version).and_return("6.6.0")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(false)
end

it "returns true when version is equal to minimum_version" do
allow(described_class).to receive(:shakapacker_version).and_return("6.5.3")
allow(described_class).to receive(:shakapacker_version).and_return("7.2.1")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(true)
end

it "returns true when version is greater than minimum_version" do
allow(described_class).to receive(:shakapacker_version).and_return("6.6.0")
allow(described_class).to receive(:shakapacker_version).and_return("7.2.3")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(true)

allow(described_class).to receive(:shakapacker_version).and_return("6.5.4")
allow(described_class).to receive(:shakapacker_version).and_return("7.3.0")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(true)

allow(described_class).to receive(:shakapacker_version).and_return("7.7.7")
allow(described_class).to receive(:shakapacker_version).and_return("8.0.0")
expect(described_class.shackapacker_version_requirement_met?(minimum_version)).to be(true)
end
end
Expand Down

0 comments on commit c891201

Please sign in to comment.