Skip to content
Snippets Groups Projects
Unverified Commit 7ed3be53 authored by Misty De Meo's avatar Misty De Meo Committed by GitHub
Browse files

Merge pull request #4642 from mistydemeo/mac_sdk_path_tests_improvement

Mac.sdk_path_if_needed tests: stub SDK check
parents bb49b50f 634e1ea0
No related branches found
No related tags found
No related merge requests found
......@@ -22,39 +22,42 @@ describe OS::Mac do
describe "::sdk_path_if_needed" do
it "calls sdk_path on Xcode-only systems" do
allow(OS::Mac::Xcode).to receive(:installed?) { true }
allow(OS::Mac::CLT).to receive(:installed?) { false }
allow(OS::Mac::Xcode).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:installed?).and_return(false)
expect(OS::Mac).to receive(:sdk_path)
OS::Mac.sdk_path_if_needed
end
it "does not call sdk_path on Xcode-and-CLT systems with system headers" do
allow(OS::Mac::Xcode).to receive(:installed?) { true }
allow(OS::Mac::CLT).to receive(:installed?) { true }
allow(OS::Mac::CLT).to receive(:separate_header_package?) { false }
allow(OS::Mac::Xcode).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:separate_header_package?).and_return(false)
expect(OS::Mac).not_to receive(:sdk_path)
OS::Mac.sdk_path_if_needed
end
it "does not call sdk_path on CLT-only systems with no CLT SDK" do
allow(OS::Mac::Xcode).to receive(:installed?) { false }
allow(OS::Mac::CLT).to receive(:installed?) { true }
allow(OS::Mac::Xcode).to receive(:installed?).and_return(false)
allow(OS::Mac::CLT).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:provides_sdk?).and_return(false)
expect(OS::Mac).not_to receive(:sdk_path)
OS::Mac.sdk_path_if_needed
end
it "does not call sdk_path on CLT-only systems with a CLT SDK if the system provides headers" do
allow(OS::Mac::Xcode).to receive(:installed?) { false }
allow(OS::Mac::CLT).to receive(:installed?) { true }
allow(OS::Mac::CLT).to receive(:separate_header_package?) { false }
allow(OS::Mac::Xcode).to receive(:installed?).and_return(false)
allow(OS::Mac::CLT).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:provides_sdk?).and_return(true)
allow(OS::Mac::CLT).to receive(:separate_header_package?).and_return(false)
expect(OS::Mac).not_to receive(:sdk_path)
OS::Mac.sdk_path_if_needed
end
it "calls sdk_path on CLT-only systems with a CLT SDK if the system does not provide headers" do
allow(OS::Mac::Xcode).to receive(:installed?) { false }
allow(OS::Mac::CLT).to receive(:installed?) { true }
allow(OS::Mac::CLT).to receive(:separate_header_package?) { true }
allow(OS::Mac::Xcode).to receive(:installed?).and_return(false)
allow(OS::Mac::CLT).to receive(:installed?).and_return(true)
allow(OS::Mac::CLT).to receive(:provides_sdk?).and_return(true)
allow(OS::Mac::CLT).to receive(:separate_header_package?).and_return(true)
expect(OS::Mac).to receive(:sdk_path)
OS::Mac.sdk_path_if_needed
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment