2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-02-18 15:11:11 -08:00
|
|
|
RSpec.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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/.",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications/.",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/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(
|
2017-02-12 15:06:54 +00:00
|
|
|
Dir.home,
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{Dir.home}/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
2019-07-23 17:09:57 +01:00
|
|
|
expect(described_class).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/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(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications/SnakeOil Professional.app",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|