2019-04-19 15:38:03 +09:00
|
|
|
# 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
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/.",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).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
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"/Applications/.",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).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
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
Dir.home,
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{Dir.home}/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).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
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{Dir.home}/Library",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{Dir.home}/Library/",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).to be_undeletable(
|
2017-02-12 15:06:54 +00:00
|
|
|
"#{Dir.home}/Library/.",
|
2016-08-18 22:11:42 +03:00
|
|
|
)
|
|
|
|
expect(MacOS).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
|
|
|
|
expect(MacOS).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
|
|
|
|
expect(MacOS).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
|