Skip to content

Commit

Permalink
[profdata] Fix xctest bundle spec
Browse files Browse the repository at this point in the history
  • Loading branch information
viteinfinite committed Dec 11, 2015
1 parent f361648 commit 341c9b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/slather/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ def binary_file

# Find the matching .app, if any
xctest_bundle_file_directory = Pathname.new(xctest_bundle_file).dirname

app_bundle_file = Dir["#{xctest_bundle_file_directory}/*.app"].first
framework_bundle_file = Dir["#{xctest_bundle_file_directory}/*.framework"].first

if app_bundle_file != nil
app_bundle_file_name_noext = Pathname.new(app_bundle_file).basename.to_s.gsub(".app", "")
"#{app_bundle_file}/#{app_bundle_file_name_noext}"
Expand Down
3 changes: 2 additions & 1 deletion spec/slather/project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ class SpecXcode7CoverageFile < Slather::ProfdataCoverageFile
end

it "should return the binary file location for a test bundle provided a scheme" do
Dir.stub(:[]).with("/Users/venmo/Library/Developer/Xcode/DerivedData/FixtureScheme/FixtureAppTests.xctest/**/FixtureAppTests").and_return(["/Users/venmo/Library/Developer/Xcode/DerivedData/FixtureScheme/FixtureAppTests.xctest/Contents/MacOS/FixtureAppTests"])
binary_file_location = fixtures_project.send(:binary_file)
expect(binary_file_location).to eq("/Users/venmo/Library/Developer/Xcode/DerivedData/FixtureScheme/FixtureAppTests.xctest/FixtureAppTests")
expect(binary_file_location).to eq("/Users/venmo/Library/Developer/Xcode/DerivedData/FixtureScheme/FixtureAppTests.xctest/Contents/MacOS/FixtureAppTests")
end

it "should return the binary file location for an app bundle provided a scheme" do
Expand Down

0 comments on commit 341c9b9

Please sign in to comment.