Revert "Added tests for os/mac/keg"

This commit is contained in:
ilovezfs 2017-09-27 02:57:12 -07:00 committed by GitHub
parent 1e69e772b5
commit 5377a42f7f

View File

@ -5,54 +5,28 @@ describe Keg do
subject { described_class.new(keg_path) } subject { described_class.new(keg_path) }
let(:keg_path) { HOMEBREW_CELLAR/"a/1.0" } describe "#mach_o_files" do
let(:file) { keg_path/"lib/i386.dylib" } let(:keg_path) { HOMEBREW_CELLAR/"a/1.0" }
before(:each) do before(:each) { (keg_path/"lib").mkpath }
(keg_path/"lib").mkpath
cp dylib_path("i386"), file
subject.link
end
after(:each) { subject.unlink } after(:each) { subject.unlink }
describe "#change_dylib_id" do it "skips hardlinks" do
it "does nothing if given id is same as file's dylib id" do cp dylib_path("i386"), keg_path/"lib/i386.dylib"
id = file.dylib_id ln keg_path/"lib/i386.dylib", keg_path/"lib/i386_hardlink.dylib"
file.change_dylib_id(id)
expect(file.dylib_id).to eq(id)
end
end
describe "#change_install_name" do subject.link
it "does nothing if given name is same as file's install name" do expect(subject.mach_o_files.count).to eq(1)
file.ensure_writable do
subject.each_install_name_for(file) do |name|
file.change_install_name(name, name)
expect(name).to eq(name)
end
end
end end
it "does nothing when install name start with '/'" do it "isn't confused by symlinks" do
file.ensure_writable do cp dylib_path("i386"), keg_path/"lib/i386.dylib"
subject.each_install_name_for(file) do |name| ln keg_path/"lib/i386.dylib", keg_path/"lib/i386_hardlink.dylib"
new_name = subject.fixed_name(file, name) ln_s keg_path/"lib/i386.dylib", keg_path/"lib/i386_symlink.dylib"
file.change_install_name(name, new_name)
expect(name).not_to eq(new_name)
end
end
end
end
describe "#require_relocation?" do subject.link
it "is set to false at initialization" do expect(subject.mach_o_files.count).to eq(1)
expect(subject.require_relocation?).to be false
end
it "is set to true after linkage is fixed" do
subject.fix_dynamic_linkage
expect(subject.require_relocation?).to be true
end end
end end
end end