brew/Library/Homebrew/test/cask/macos_spec.rb

70 lines
1.7 KiB
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-03-06 04:31:16 +01:00
describe MacOS, :cask do
2016-08-18 22:11:42 +03:00
it "says '/' is undeletable" do
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/.",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/usr/local/Library/Taps/../../../..",
2016-08-18 22:11:42 +03:00
)
end
it "says '/Applications' is undeletable" do
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/Applications",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/Applications/",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/Applications/.",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"/Applications/Mail.app/..",
2016-08-18 22:11:42 +03:00
)
end
it "says the home directory is undeletable" do
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
Dir.home,
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"#{Dir.home}/",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"#{Dir.home}/Documents/..",
2016-08-18 22:11:42 +03:00
)
end
it "says the user library directory is undeletable" do
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"#{Dir.home}/Library",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"#{Dir.home}/Library/",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"#{Dir.home}/Library/.",
2016-08-18 22:11:42 +03:00
)
2019-07-23 17:09:57 +01:00
expect(described_class).to be_undeletable(
"#{Dir.home}/Library/Preferences/..",
2016-08-18 22:11:42 +03:00
)
end
it "says '/Applications/.app' is deletable" do
2019-07-23 17:09:57 +01:00
expect(described_class).not_to be_undeletable(
"/Applications/.app",
2016-08-18 22:11:42 +03:00
)
end
it "says '/Applications/SnakeOil Professional.app' is deletable" do
2019-07-23 17:09:57 +01:00
expect(described_class).not_to be_undeletable(
"/Applications/SnakeOil Professional.app",
2016-08-18 22:11:42 +03:00
)
end
end