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

68 lines
1.5 KiB
Ruby
Raw Normal View History

2016-08-18 22:11:42 +03:00
describe MacOS do
it "says '/' is undeletable" do
expect(MacOS).to be_undeletable(
"/",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"/.",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"/usr/local/Library/Taps/../../../..",
2016-08-18 22:11:42 +03:00
)
end
it "says '/Applications' is undeletable" do
expect(MacOS).to be_undeletable(
"/Applications",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"/Applications/",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"/Applications/.",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"/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(
Dir.home,
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"#{Dir.home}/",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"#{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(
"#{Dir.home}/Library",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"#{Dir.home}/Library/",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"#{Dir.home}/Library/.",
2016-08-18 22:11:42 +03:00
)
expect(MacOS).to be_undeletable(
"#{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(
"/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(
"/Applications/SnakeOil Professional.app",
2016-08-18 22:11:42 +03:00
)
end
end