brew style --fix
This commit is contained in:
parent
1ee0475a22
commit
7349c2b996
@ -19,7 +19,7 @@ describe Cask::Artifact::PostflightBlock, :cask do
|
||||
end
|
||||
|
||||
expect(called).to be true
|
||||
expect(yielded_arg).to be_kind_of(Cask::DSL::Postflight)
|
||||
expect(yielded_arg).to be_a(Cask::DSL::Postflight)
|
||||
end
|
||||
end
|
||||
|
||||
@ -40,7 +40,7 @@ describe Cask::Artifact::PostflightBlock, :cask do
|
||||
end
|
||||
|
||||
expect(called).to be true
|
||||
expect(yielded_arg).to be_kind_of(Cask::DSL::UninstallPostflight)
|
||||
expect(yielded_arg).to be_a(Cask::DSL::UninstallPostflight)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -19,7 +19,7 @@ describe Cask::Artifact::PreflightBlock, :cask do
|
||||
end
|
||||
|
||||
expect(called).to be true
|
||||
expect(yielded_arg).to be_kind_of Cask::DSL::Preflight
|
||||
expect(yielded_arg).to be_a Cask::DSL::Preflight
|
||||
end
|
||||
end
|
||||
|
||||
@ -40,7 +40,7 @@ describe Cask::Artifact::PreflightBlock, :cask do
|
||||
end
|
||||
|
||||
expect(called).to be true
|
||||
expect(yielded_arg).to be_kind_of Cask::DSL::UninstallPreflight
|
||||
expect(yielded_arg).to be_a Cask::DSL::UninstallPreflight
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -31,19 +31,19 @@ describe Cask::Cask, :cask do
|
||||
|
||||
it "returns an instance of the Cask for the given token" do
|
||||
c = Cask::CaskLoader.load("local-caffeine")
|
||||
expect(c).to be_kind_of(described_class)
|
||||
expect(c).to be_a(described_class)
|
||||
expect(c.token).to eq("local-caffeine")
|
||||
end
|
||||
|
||||
it "returns an instance of the Cask from a specific file location" do
|
||||
c = Cask::CaskLoader.load("#{tap_path}/Casks/local-caffeine.rb")
|
||||
expect(c).to be_kind_of(described_class)
|
||||
expect(c).to be_a(described_class)
|
||||
expect(c.token).to eq("local-caffeine")
|
||||
end
|
||||
|
||||
it "returns an instance of the Cask from a URL" do
|
||||
c = Cask::CaskLoader.load("file://#{tap_path}/Casks/local-caffeine.rb")
|
||||
expect(c).to be_kind_of(described_class)
|
||||
expect(c).to be_a(described_class)
|
||||
expect(c.token).to eq("local-caffeine")
|
||||
end
|
||||
|
||||
@ -57,7 +57,7 @@ describe Cask::Cask, :cask do
|
||||
|
||||
it "returns an instance of the Cask from a relative file location" do
|
||||
c = Cask::CaskLoader.load(relative_tap_path/"Casks/local-caffeine.rb")
|
||||
expect(c).to be_kind_of(described_class)
|
||||
expect(c).to be_a(described_class)
|
||||
expect(c.token).to eq("local-caffeine")
|
||||
end
|
||||
|
||||
|
||||
@ -25,13 +25,13 @@ describe AbstractDownloadStrategy do
|
||||
let(:specs) { { bottle: true } }
|
||||
|
||||
it "extends Pourable" do
|
||||
expect(strategy).to be_a_kind_of(AbstractDownloadStrategy::Pourable)
|
||||
expect(strategy).to be_a(AbstractDownloadStrategy::Pourable)
|
||||
end
|
||||
end
|
||||
|
||||
context "without specs[:bottle]" do
|
||||
it "is does not extend Pourable" do
|
||||
expect(strategy).not_to be_a_kind_of(AbstractDownloadStrategy::Pourable)
|
||||
expect(strategy).not_to be_a(AbstractDownloadStrategy::Pourable)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -241,7 +241,7 @@ describe Formula do
|
||||
specify "#prefix" do
|
||||
f = Testball.new
|
||||
expect(f.prefix).to eq(HOMEBREW_CELLAR/f.name/"0.1")
|
||||
expect(f.prefix).to be_kind_of(Pathname)
|
||||
expect(f.prefix).to be_a(Pathname)
|
||||
end
|
||||
|
||||
example "revised prefix" do
|
||||
@ -670,8 +670,8 @@ describe Formula do
|
||||
url "foo-1.0"
|
||||
end
|
||||
|
||||
expect(f.class.stable).to be_kind_of(SoftwareSpec)
|
||||
expect(f.class.head).to be_kind_of(SoftwareSpec)
|
||||
expect(f.class.stable).to be_a(SoftwareSpec)
|
||||
expect(f.class.head).to be_a(SoftwareSpec)
|
||||
end
|
||||
|
||||
specify "instance specs have different references" do
|
||||
|
||||
@ -62,11 +62,11 @@ describe Formulary do
|
||||
end
|
||||
|
||||
it "returns a Formula" do
|
||||
expect(described_class.factory(formula_name)).to be_kind_of(Formula)
|
||||
expect(described_class.factory(formula_name)).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "returns a Formula when given a fully qualified name" do
|
||||
expect(described_class.factory("homebrew/core/#{formula_name}")).to be_kind_of(Formula)
|
||||
expect(described_class.factory("homebrew/core/#{formula_name}")).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "raises an error if the Formula cannot be found" do
|
||||
@ -98,19 +98,19 @@ describe Formulary do
|
||||
end
|
||||
|
||||
it "returns a Formula when given a path" do
|
||||
expect(described_class.factory(formula_path)).to be_kind_of(Formula)
|
||||
expect(described_class.factory(formula_path)).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "returns a Formula when given a URL" do
|
||||
formula = described_class.factory("file://#{formula_path}")
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
end
|
||||
|
||||
context "when given a bottle" do
|
||||
subject(:formula) { described_class.factory(bottle) }
|
||||
|
||||
it "returns a Formula" do
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "calling #local_bottle_path on the returned Formula returns the bottle path" do
|
||||
@ -130,7 +130,7 @@ describe Formulary do
|
||||
end
|
||||
|
||||
it "returns a Formula" do
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "calling #alias_path on the returned Formula returns the alias path" do
|
||||
@ -153,7 +153,7 @@ describe Formulary do
|
||||
installer.install
|
||||
|
||||
f = described_class.from_rack(installed_formula.rack)
|
||||
expect(f).to be_kind_of(Formula)
|
||||
expect(f).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "returns a Formula when given a Keg" do
|
||||
@ -162,7 +162,7 @@ describe Formulary do
|
||||
|
||||
keg = Keg.new(installed_formula.prefix)
|
||||
f = described_class.from_keg(keg)
|
||||
expect(f).to be_kind_of(Formula)
|
||||
expect(f).to be_a(Formula)
|
||||
end
|
||||
end
|
||||
|
||||
@ -172,14 +172,14 @@ describe Formulary do
|
||||
let(:formula_path) { tap.path/"#{formula_name}.rb" }
|
||||
|
||||
it "returns a Formula when given a name" do
|
||||
expect(described_class.factory(formula_name)).to be_kind_of(Formula)
|
||||
expect(described_class.factory(formula_name)).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "returns a Formula from an Alias path" do
|
||||
alias_dir = tap.path/"Aliases"
|
||||
alias_dir.mkpath
|
||||
FileUtils.ln_s formula_path, alias_dir/"bar"
|
||||
expect(described_class.factory("bar")).to be_kind_of(Formula)
|
||||
expect(described_class.factory("bar")).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "raises an error when the Formula cannot be found" do
|
||||
@ -189,7 +189,7 @@ describe Formulary do
|
||||
end
|
||||
|
||||
it "returns a Formula when given a fully qualified name" do
|
||||
expect(described_class.factory("#{tap}/#{formula_name}")).to be_kind_of(Formula)
|
||||
expect(described_class.factory("#{tap}/#{formula_name}")).to be_a(Formula)
|
||||
end
|
||||
|
||||
it "raises an error if a Formula is in multiple Taps" do
|
||||
@ -288,7 +288,7 @@ describe Formulary do
|
||||
allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.keg_only_reason.reason).to eq :provided_by_macos
|
||||
if OS.mac?
|
||||
expect(formula.deps.count).to eq 4
|
||||
@ -306,7 +306,7 @@ describe Formulary do
|
||||
allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(deprecate_json)
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.deprecated?).to be true
|
||||
expect {
|
||||
formula.install
|
||||
@ -317,7 +317,7 @@ describe Formulary do
|
||||
allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(disable_json)
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.disabled?).to be true
|
||||
expect {
|
||||
formula.install
|
||||
@ -328,7 +328,7 @@ describe Formulary do
|
||||
allow(Homebrew::API::Formula).to receive(:all_formulae).and_return formula_json_contents(variations_json)
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.deps.count).to eq 5
|
||||
expect(formula.deps.map(&:name).include?("variations_dep")).to be true
|
||||
end
|
||||
@ -338,7 +338,7 @@ describe Formulary do
|
||||
.to receive(:all_formulae).and_return formula_json_contents(linux_variations_json)
|
||||
|
||||
formula = described_class.factory(formula_name)
|
||||
expect(formula).to be_kind_of(Formula)
|
||||
expect(formula).to be_a(Formula)
|
||||
expect(formula.deps.count).to eq 5
|
||||
expect(formula.deps.map(&:name).include?("uses_from_macos_dep")).to be true
|
||||
end
|
||||
@ -346,7 +346,7 @@ describe Formulary do
|
||||
end
|
||||
|
||||
specify "::from_contents" do
|
||||
expect(described_class.from_contents(formula_name, formula_path, formula_content)).to be_kind_of(Formula)
|
||||
expect(described_class.from_contents(formula_name, formula_path, formula_content)).to be_a(Formula)
|
||||
end
|
||||
|
||||
describe "::to_rack" do
|
||||
|
||||
@ -8,7 +8,7 @@ describe Patch do
|
||||
context "with a simple patch" do
|
||||
subject { described_class.create(:p2, nil) }
|
||||
|
||||
it { is_expected.to be_kind_of ExternalPatch }
|
||||
it { is_expected.to be_a ExternalPatch }
|
||||
it { is_expected.to be_external }
|
||||
its(:strip) { is_expected.to eq(:p2) }
|
||||
end
|
||||
@ -16,28 +16,28 @@ describe Patch do
|
||||
context "with a string patch" do
|
||||
subject { described_class.create(:p0, "foo") }
|
||||
|
||||
it { is_expected.to be_kind_of StringPatch }
|
||||
it { is_expected.to be_a StringPatch }
|
||||
its(:strip) { is_expected.to eq(:p0) }
|
||||
end
|
||||
|
||||
context "with a string patch without strip" do
|
||||
subject { described_class.create("foo", nil) }
|
||||
|
||||
it { is_expected.to be_kind_of StringPatch }
|
||||
it { is_expected.to be_a StringPatch }
|
||||
its(:strip) { is_expected.to eq(:p1) }
|
||||
end
|
||||
|
||||
context "with a data patch" do
|
||||
subject { described_class.create(:p0, :DATA) }
|
||||
|
||||
it { is_expected.to be_kind_of DATAPatch }
|
||||
it { is_expected.to be_a DATAPatch }
|
||||
its(:strip) { is_expected.to eq(:p0) }
|
||||
end
|
||||
|
||||
context "with a data patch without strip" do
|
||||
subject { described_class.create(:DATA, nil) }
|
||||
|
||||
it { is_expected.to be_kind_of DATAPatch }
|
||||
it { is_expected.to be_a DATAPatch }
|
||||
its(:strip) { is_expected.to eq(:p1) }
|
||||
end
|
||||
|
||||
@ -56,7 +56,7 @@ describe Patch do
|
||||
subject(:patch) { described_class.create(:p2, nil) }
|
||||
|
||||
context "when the patch is empty" do
|
||||
its(:resource) { is_expected.to be_kind_of Resource::PatchResource }
|
||||
its(:resource) { is_expected.to be_a Resource::PatchResource }
|
||||
its(:patch_files) { is_expected.to eq(patch.resource.patch_files) }
|
||||
its(:patch_files) { is_expected.to eq([]) }
|
||||
end
|
||||
|
||||
@ -99,7 +99,7 @@ describe Tab do
|
||||
tab = described_class.new(homebrew_version: "1.2.3")
|
||||
expect(tab.parsed_homebrew_version).to eq("1.2.3")
|
||||
expect(tab.parsed_homebrew_version).to be < "1.2.3-1-g12789abdf"
|
||||
expect(tab.parsed_homebrew_version).to be_kind_of(Version)
|
||||
expect(tab.parsed_homebrew_version).to be_a(Version)
|
||||
|
||||
tab.homebrew_version = "1.2.4-567-g12789abdf"
|
||||
expect(tab.parsed_homebrew_version).to be > "1.2.4"
|
||||
|
||||
@ -96,10 +96,10 @@ describe Tap do
|
||||
end
|
||||
|
||||
specify "::fetch" do
|
||||
expect(described_class.fetch("Homebrew", "core")).to be_kind_of(CoreTap)
|
||||
expect(described_class.fetch("Homebrew", "homebrew")).to be_kind_of(CoreTap)
|
||||
expect(described_class.fetch("Homebrew", "core")).to be_a(CoreTap)
|
||||
expect(described_class.fetch("Homebrew", "homebrew")).to be_a(CoreTap)
|
||||
tap = described_class.fetch("Homebrew", "foo")
|
||||
expect(tap).to be_kind_of(described_class)
|
||||
expect(tap).to be_a(described_class)
|
||||
expect(tap.name).to eq("homebrew/foo")
|
||||
|
||||
expect {
|
||||
@ -173,7 +173,7 @@ describe Tap do
|
||||
expect(homebrew_foo_tap.formula_renames).to eq("oldname" => "foo")
|
||||
expect(homebrew_foo_tap.tap_migrations).to eq("removed-formula" => "homebrew/foo")
|
||||
expect(homebrew_foo_tap.command_files).to eq([cmd_file])
|
||||
expect(homebrew_foo_tap.to_hash).to be_kind_of(Hash)
|
||||
expect(homebrew_foo_tap.to_hash).to be_a(Hash)
|
||||
expect(homebrew_foo_tap).to have_formula_file(formula_file)
|
||||
expect(homebrew_foo_tap).to have_formula_file("Formula/foo.rb")
|
||||
expect(homebrew_foo_tap).not_to have_formula_file("bar.rb")
|
||||
|
||||
@ -10,7 +10,7 @@ describe Tty do
|
||||
|
||||
describe "::width" do
|
||||
it "returns an Integer" do
|
||||
expect(described_class.width).to be_kind_of(Integer)
|
||||
expect(described_class.width).to be_a(Integer)
|
||||
end
|
||||
|
||||
it "cannot be negative" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user