replace undent with squiggly heredoc
This commit is contained in:
parent
10845a1122
commit
1dbeee826d
@ -11,7 +11,7 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do
|
|||||||
|
|
||||||
context "when the homepage URL ends with a slash" do
|
context "when the homepage URL ends with a slash" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
homepage 'https://foo.brew.sh/'
|
homepage 'https://foo.brew.sh/'
|
||||||
end
|
end
|
||||||
@ -23,7 +23,7 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do
|
|||||||
|
|
||||||
context "when the homepage URL does not end with a slash but has a path" do
|
context "when the homepage URL does not end with a slash but has a path" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
homepage 'https://foo.brew.sh/path'
|
homepage 'https://foo.brew.sh/path'
|
||||||
end
|
end
|
||||||
@ -35,14 +35,14 @@ describe RuboCop::Cop::Cask::HomepageUrlTrailingSlash do
|
|||||||
|
|
||||||
context "when the homepage URL does not end with a slash and has no path" do
|
context "when the homepage URL does not end with a slash and has no path" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
homepage 'https://foo.brew.sh'
|
homepage 'https://foo.brew.sh'
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
homepage 'https://foo.brew.sh/'
|
homepage 'https://foo.brew.sh/'
|
||||||
end
|
end
|
||||||
|
|||||||
@ -12,7 +12,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
context "when auditing `postflight` stanzas" do
|
context "when auditing `postflight` stanzas" do
|
||||||
context "when there are no on_system blocks" do
|
context "when there are no on_system blocks" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
foobar
|
foobar
|
||||||
@ -26,7 +26,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is an `on_intel` block" do
|
context "when there is an `on_intel` block" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
on_intel do
|
on_intel do
|
||||||
@ -37,7 +37,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
if Hardware::CPU.intel?
|
if Hardware::CPU.intel?
|
||||||
@ -64,7 +64,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is an `on_monterey` block" do
|
context "when there is an `on_monterey` block" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
on_monterey do
|
on_monterey do
|
||||||
@ -75,7 +75,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
if MacOS.version == :monterey
|
if MacOS.version == :monterey
|
||||||
@ -102,7 +102,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is an `on_monterey :or_older` block" do
|
context "when there is an `on_monterey :or_older` block" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
on_monterey :or_older do
|
on_monterey :or_older do
|
||||||
@ -113,7 +113,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
postflight do
|
postflight do
|
||||||
if MacOS.version <= :monterey
|
if MacOS.version <= :monterey
|
||||||
@ -143,7 +143,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
context "when auditing `sha256` stanzas inside on_arch blocks" do
|
context "when auditing `sha256` stanzas inside on_arch blocks" do
|
||||||
context "when there are no on_arch blocks" do
|
context "when there are no on_arch blocks" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
end
|
end
|
||||||
@ -155,7 +155,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when the proper `sha256` stanza is used" do
|
context "when the proper `sha256` stanza is used" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
sha256 arm: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94",
|
sha256 arm: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94",
|
||||||
intel: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
|
intel: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
|
||||||
@ -168,7 +168,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when the `sha256` stanza needs to be removed from the on_arch blocks" do
|
context "when the `sha256` stanza needs to be removed from the on_arch blocks" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
on_intel do
|
on_intel do
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
@ -180,7 +180,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
#{" "}
|
#{" "}
|
||||||
sha256 arm: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b", intel: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 arm: "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b", intel: "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
@ -188,7 +188,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:offense_source) do
|
let(:offense_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
on_arm do
|
on_arm do
|
||||||
sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
|
sha256 "8c62a2b791cf5f0da6066a0a4b6e85f62949cd60975da062df44adf887f4370b"
|
||||||
end
|
end
|
||||||
@ -213,7 +213,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is only one on_arch block" do
|
context "when there is only one on_arch block" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
on_intel do
|
on_intel do
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
@ -227,7 +227,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is also a `version` stanza inside the on_arch blocks" do
|
context "when there is also a `version` stanza inside the on_arch blocks" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
on_intel do
|
on_intel do
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
@ -246,7 +246,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is also a `version` stanza inside only a single on_arch block" do
|
context "when there is also a `version` stanza inside only a single on_arch block" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
on_intel do
|
on_intel do
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
@ -266,7 +266,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
context "when auditing loose `Hardware::CPU` method calls" do
|
context "when auditing loose `Hardware::CPU` method calls" do
|
||||||
context "when there is a `Hardware::CPU.arm?` reference" do
|
context "when there is a `Hardware::CPU.arm?` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if Hardware::CPU.arm? && other_condition
|
if Hardware::CPU.arm? && other_condition
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
@ -291,7 +291,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is a `Hardware::CPU.intel?` reference" do
|
context "when there is a `Hardware::CPU.intel?` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if Hardware::CPU.intel? && other_condition
|
if Hardware::CPU.intel? && other_condition
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
@ -316,7 +316,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is a `Hardware::CPU.arch` reference" do
|
context "when there is a `Hardware::CPU.arch` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version "1.2.3"
|
version "1.2.3"
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
@ -342,7 +342,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
context "when auditing loose `MacOS.version` method calls" do
|
context "when auditing loose `MacOS.version` method calls" do
|
||||||
context "when there is a `MacOS.version ==` reference" do
|
context "when there is a `MacOS.version ==` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if MacOS.version == :catalina
|
if MacOS.version == :catalina
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
@ -367,7 +367,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is a `MacOS.version <=` reference" do
|
context "when there is a `MacOS.version <=` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if MacOS.version <= :catalina
|
if MacOS.version <= :catalina
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
@ -392,7 +392,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is a `MacOS.version >=` reference" do
|
context "when there is a `MacOS.version >=` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if MacOS.version >= :catalina
|
if MacOS.version >= :catalina
|
||||||
version "1.0.0"
|
version "1.0.0"
|
||||||
@ -417,7 +417,7 @@ describe RuboCop::Cop::Cask::OnSystemConditionals do
|
|||||||
|
|
||||||
context "when there is a `MacOS.version` reference" do
|
context "when there is a `MacOS.version` reference" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version "1.2.3"
|
version "1.2.3"
|
||||||
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
sha256 "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
|
||||||
|
|||||||
@ -18,7 +18,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when there is only one stanza" do
|
context "when there is only one stanza" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
end
|
end
|
||||||
@ -30,7 +30,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when no stanzas are incorrectly grouped" do
|
context "when no stanzas are incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -43,7 +43,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when no stanzas or variable assignments are incorrectly grouped" do
|
context "when no stanzas or variable assignments are incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -59,7 +59,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when one stanza is incorrectly grouped" do
|
context "when one stanza is incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -92,7 +92,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when the arch stanza is incorrectly grouped" do
|
context "when the arch stanza is incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
version :latest
|
version :latest
|
||||||
@ -101,7 +101,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when one variable assignment is incorrectly grouped" do
|
context "when one variable assignment is incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -137,7 +137,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -164,7 +164,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when many stanzas are incorrectly grouped" do
|
context "when many stanzas are incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -181,7 +181,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -232,7 +232,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when many stanzas and variable assignments are incorrectly grouped" do
|
context "when many stanzas and variable assignments are incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -253,7 +253,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -320,7 +320,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when caveats stanza is incorrectly grouped" do
|
context "when caveats stanza is incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
format(<<-CASK.undent, caveats: caveats.strip)
|
format(<<~CASK, caveats: caveats.strip)
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -332,7 +332,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
format(<<-CASK.undent, caveats: caveats.strip)
|
format(<<~CASK, caveats: caveats.strip)
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -384,7 +384,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when the postflight stanza is incorrectly grouped" do
|
context "when the postflight stanza is incorrectly grouped" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -398,7 +398,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -420,7 +420,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when a stanza has a comment" do
|
context "when a stanza has a comment" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -437,7 +437,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -462,7 +462,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
|
|
||||||
context "when a stanza has a comment and there is a variable assignment" do
|
context "when a stanza has a comment and there is a variable assignment" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -481,7 +481,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64", intel: "x86_64"
|
arch arm: "arm64", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -509,7 +509,7 @@ describe RuboCop::Cop::Cask::StanzaGrouping do
|
|||||||
# TODO: detect incorrectly grouped stanzas in nested expressions
|
# TODO: detect incorrectly grouped stanzas in nested expressions
|
||||||
context "when stanzas are nested in a conditional expression" do
|
context "when stanzas are nested in a conditional expression" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if true
|
if true
|
||||||
version :latest
|
version :latest
|
||||||
|
|||||||
@ -11,7 +11,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when there is only one stanza" do
|
context "when there is only one stanza" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
end
|
end
|
||||||
@ -23,7 +23,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when no stanzas are out of order" do
|
context "when no stanzas are out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm", intel: "x86_64"
|
arch arm: "arm", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -39,7 +39,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when one pair of stanzas is out of order" do
|
context "when one pair of stanzas is out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
version :latest
|
version :latest
|
||||||
@ -47,7 +47,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -77,7 +77,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when the arch stanza is out of order" do
|
context "when the arch stanza is out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -86,7 +86,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm", intel: "x86_64"
|
arch arm: "arm", intel: "x86_64"
|
||||||
version :latest
|
version :latest
|
||||||
@ -123,7 +123,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when an arch variable assignment is out of order" do
|
context "when an arch variable assignment is out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm", intel: "x86_64"
|
arch arm: "arm", intel: "x86_64"
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -133,7 +133,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm", intel: "x86_64"
|
arch arm: "arm", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -165,7 +165,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when an arch variable assignment is above the arch stanza" do
|
context "when an arch variable assignment is above the arch stanza" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
arch arm: "arm", intel: "x86_64"
|
arch arm: "arm", intel: "x86_64"
|
||||||
@ -175,7 +175,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm", intel: "x86_64"
|
arch arm: "arm", intel: "x86_64"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -207,7 +207,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when many stanzas are out of order" do
|
context "when many stanzas are out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
uninstall :quit => 'com.example.foo',
|
uninstall :quit => 'com.example.foo',
|
||||||
@ -219,7 +219,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -266,7 +266,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when a stanza appears multiple times" do
|
context "when a stanza appears multiple times" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
name 'Foo'
|
name 'Foo'
|
||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
@ -279,7 +279,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -299,7 +299,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when a stanza has a comment" do
|
context "when a stanza has a comment" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
# comment with an empty line between
|
# comment with an empty line between
|
||||||
@ -313,7 +313,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check # comment on same line
|
sha256 :no_check # comment on same line
|
||||||
@ -332,7 +332,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when a variable assignment is out of order with a comment" do
|
context "when a variable assignment is out of order with a comment" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -347,7 +347,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin" # comment on same line
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin" # comment on same line
|
||||||
version :latest
|
version :latest
|
||||||
@ -367,7 +367,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when the caveats stanza is out of order" do
|
context "when the caveats stanza is out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
format(<<-CASK.undent, caveats: caveats.strip)
|
format(<<~CASK, caveats: caveats.strip)
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
name 'Foo'
|
name 'Foo'
|
||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
@ -379,7 +379,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
format(<<-CASK.undent, caveats: caveats.strip)
|
format(<<~CASK, caveats: caveats.strip)
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -428,7 +428,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
|
|
||||||
context "when the postflight stanza is out of order" do
|
context "when the postflight stanza is out of order" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
name 'Foo'
|
name 'Foo'
|
||||||
url 'https://foo.brew.sh/foo.zip'
|
url 'https://foo.brew.sh/foo.zip'
|
||||||
@ -442,7 +442,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version :latest
|
version :latest
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
@ -462,7 +462,7 @@ describe RuboCop::Cop::Cask::StanzaOrder do
|
|||||||
# TODO: detect out-of-order stanzas in nested expressions
|
# TODO: detect out-of-order stanzas in nested expressions
|
||||||
context "when stanzas are nested in a conditional expression" do
|
context "when stanzas are nested in a conditional expression" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
if true
|
if true
|
||||||
sha256 :no_check
|
sha256 :no_check
|
||||||
|
|||||||
@ -11,7 +11,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do
|
|||||||
|
|
||||||
context "when url version interpolation does not include version.before_comma or version.after_comma" do
|
context "when url version interpolation does not include version.before_comma or version.after_comma" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version '1.1'
|
version '1.1'
|
||||||
url 'https://foo.brew.sh/foo-\#{version}.dmg'
|
url 'https://foo.brew.sh/foo-\#{version}.dmg'
|
||||||
@ -24,7 +24,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do
|
|||||||
|
|
||||||
context "when the url uses csv" do
|
context "when the url uses csv" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version '1.1,111'
|
version '1.1,111'
|
||||||
url 'https://foo.brew.sh/foo-\#{version.csv.first}.dmg'
|
url 'https://foo.brew.sh/foo-\#{version.csv.first}.dmg'
|
||||||
@ -37,7 +37,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do
|
|||||||
|
|
||||||
context "when the url uses version.before_comma" do
|
context "when the url uses version.before_comma" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version '1.1,111'
|
version '1.1,111'
|
||||||
url 'https://foo.brew.sh/foo-\#{version.before_comma}.dmg'
|
url 'https://foo.brew.sh/foo-\#{version.before_comma}.dmg'
|
||||||
@ -45,7 +45,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version '1.1,111'
|
version '1.1,111'
|
||||||
url 'https://foo.brew.sh/foo-\#{version.csv.first}.dmg'
|
url 'https://foo.brew.sh/foo-\#{version.csv.first}.dmg'
|
||||||
@ -70,7 +70,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do
|
|||||||
|
|
||||||
context "when the url uses version.after_comma" do
|
context "when the url uses version.after_comma" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version '1.1,111'
|
version '1.1,111'
|
||||||
url 'https://foo.brew.sh/foo-\#{version.after_comma}.dmg'
|
url 'https://foo.brew.sh/foo-\#{version.after_comma}.dmg'
|
||||||
@ -78,7 +78,7 @@ describe RuboCop::Cop::Cask::UrlLegacyCommaSeparators do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
version '1.1,111'
|
version '1.1,111'
|
||||||
url 'https://foo.brew.sh/foo-\#{version.csv.second}.dmg'
|
url 'https://foo.brew.sh/foo-\#{version.csv.second}.dmg'
|
||||||
|
|||||||
@ -11,7 +11,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there are no variables" do
|
context "when there are no variables" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask "foo" do
|
cask "foo" do
|
||||||
version :latest
|
version :latest
|
||||||
end
|
end
|
||||||
@ -23,7 +23,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is an arch stanza" do
|
context "when there is an arch stanza" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask "foo" do
|
cask "foo" do
|
||||||
arch arm: "darwin-arm64", intel: "darwin"
|
arch arm: "darwin-arm64", intel: "darwin"
|
||||||
end
|
end
|
||||||
@ -35,7 +35,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is a non-arch variable that uses the arch conditional" do
|
context "when there is a non-arch variable that uses the arch conditional" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask "foo" do
|
cask "foo" do
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
end
|
end
|
||||||
@ -47,14 +47,14 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is an arch variable" do
|
context "when there is an arch variable" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"
|
arch = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "darwin-arm64", intel: "darwin"
|
arch arm: "darwin-arm64", intel: "darwin"
|
||||||
end
|
end
|
||||||
@ -78,14 +78,14 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is an arch variable that doesn't use strings" do
|
context "when there is an arch variable that doesn't use strings" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch = Hardware::CPU.intel? ? :darwin : :darwin_arm64
|
arch = Hardware::CPU.intel? ? :darwin : :darwin_arm64
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: :darwin_arm64, intel: :darwin
|
arch arm: :darwin_arm64, intel: :darwin
|
||||||
end
|
end
|
||||||
@ -109,14 +109,14 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is an arch with an empty string" do
|
context "when there is an arch with an empty string" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch = Hardware::CPU.intel? ? "" : "arm64"
|
arch = Hardware::CPU.intel? ? "" : "arm64"
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "arm64"
|
arch arm: "arm64"
|
||||||
end
|
end
|
||||||
@ -140,14 +140,14 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is a non-arch variable" do
|
context "when there is a non-arch variable" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"
|
folder = Hardware::CPU.intel? ? "darwin" : "darwin-arm64"
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
end
|
end
|
||||||
@ -171,14 +171,14 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is a non-arch variable with an empty string" do
|
context "when there is a non-arch variable with an empty string" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = Hardware::CPU.intel? ? "amd64" : ""
|
folder = Hardware::CPU.intel? ? "amd64" : ""
|
||||||
end
|
end
|
||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = on_arch_conditional intel: "amd64"
|
folder = on_arch_conditional intel: "amd64"
|
||||||
end
|
end
|
||||||
@ -202,7 +202,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there is an arch and a non-arch variable" do
|
context "when there is an arch and a non-arch variable" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"
|
arch = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"
|
||||||
folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"
|
folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"
|
||||||
@ -210,7 +210,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
arch arm: "darwin-arm64", intel: "darwin"
|
arch arm: "darwin-arm64", intel: "darwin"
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
@ -242,7 +242,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
|
|
||||||
context "when there are two non-arch variables" do
|
context "when there are two non-arch variables" do
|
||||||
let(:source) do
|
let(:source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"
|
folder = Hardware::CPU.arm? ? "darwin-arm64" : "darwin"
|
||||||
platform = Hardware::CPU.intel? ? "darwin": "darwin-arm64"
|
platform = Hardware::CPU.intel? ? "darwin": "darwin-arm64"
|
||||||
@ -250,7 +250,7 @@ describe RuboCop::Cop::Cask::Variables do
|
|||||||
CASK
|
CASK
|
||||||
end
|
end
|
||||||
let(:correct_source) do
|
let(:correct_source) do
|
||||||
<<-CASK.undent
|
<<~CASK
|
||||||
cask 'foo' do
|
cask 'foo' do
|
||||||
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
platform = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
platform = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user