slather 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +6 -0
- data/Rakefile +3 -4
- data/lib/slather/coverage_service/cobertura_xml_output.rb +1 -0
- data/lib/slather/project.rb +21 -9
- data/lib/slather/version.rb +1 -1
- data/slather.gemspec +2 -2
- data/spec/slather/coverage_file_spec.rb +3 -3
- data/spec/slather/coverage_service/coveralls_spec.rb +22 -22
- data/spec/slather/coverage_service/hardcover_spec.rb +10 -10
- data/spec/slather/coverage_service/html_output_spec.rb +4 -4
- data/spec/slather/profdata_coverage_spec.rb +1 -1
- data/spec/slather/project_spec.rb +57 -57
- data/spec/spec_helper.rb +3 -2
- metadata +6 -6
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5346e7ae5cba9037d3f9386b52acbdf4a4b40c91
         | 
| 4 | 
            +
              data.tar.gz: c6c6736662bc1f1f2730cf4fc351e131687b6d92
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ecd69108753a0d5bc1fd1cb0b89a6d1a98b970a26f29d1af4e7cef63a1b19c9b197212e01828da90a03f85c5a5ae5856c73dbef9959f5b5eaf448caf3c38b1e3
         | 
| 7 | 
            +
              data.tar.gz: bf38de9f006be3f6ec9ad966435ecb45ace99bc716a483a7eba1b6c0b69294b7f5409aeaa0a88f57a6bfda45846357e15ebbbecebcd7f4cda12128df59f84704
         | 
    
        data/.travis.yml
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            language: objective-c
         | 
| 2 | 
            -
            script: bundle exec  | 
| 2 | 
            +
            script: bundle exec rake
         | 
| 3 3 | 
             
            osx_image: xcode7
         | 
| 4 4 |  | 
| 5 5 | 
             
            # Sets Travis to run the Ruby specs on OS X machines which are required to
         | 
| @@ -17,4 +17,4 @@ before_install: | |
| 17 17 | 
             
              - if [[ $RVM_RUBY_VERSION == 'system' ]]; then sudo gem install bundler --no-ri --no-rdoc; else gem install bundler --no-ri --no-rdoc; fi
         | 
| 18 18 |  | 
| 19 19 | 
             
            install:
         | 
| 20 | 
            -
              - bundle install --without=documentation | 
| 20 | 
            +
              - bundle install --without=documentation
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -2,6 +2,12 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            ## master
         | 
| 4 4 |  | 
| 5 | 
            +
            ## v2.0.1
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            * Fixes how `profdata_coverage_dir` is created.
         | 
| 8 | 
            +
              [guidomb](https://github.com/guidomb)
         | 
| 9 | 
            +
              [#145](https://github.com/SlatherOrg/slather/pull/145)
         | 
| 10 | 
            +
             | 
| 5 11 | 
             
            ## v2.0.0
         | 
| 6 12 | 
             
            * Correct html rendering when using profdata format   
         | 
| 7 13 | 
             
              [cutz](https://github.com/cutz)
         | 
    
        data/Rakefile
    CHANGED
    
    
    
        data/lib/slather/project.rb
    CHANGED
    
    | @@ -50,7 +50,7 @@ end | |
| 50 50 | 
             
            module Slather
         | 
| 51 51 | 
             
              class Project < Xcodeproj::Project
         | 
| 52 52 |  | 
| 53 | 
            -
                attr_accessor :build_directory, :ignore_list, :ci_service, :coverage_service, :coverage_access_token, :source_directory, | 
| 53 | 
            +
                attr_accessor :build_directory, :ignore_list, :ci_service, :coverage_service, :coverage_access_token, :source_directory,
         | 
| 54 54 | 
             
                  :output_directory, :xcodeproj, :show_html, :verbose_mode, :input_format, :scheme, :binary_file, :binary_basename
         | 
| 55 55 |  | 
| 56 56 | 
             
                alias_method :setup_for_coverage, :slather_setup_for_coverage
         | 
| @@ -100,13 +100,24 @@ module Slather | |
| 100 100 | 
             
                end
         | 
| 101 101 | 
             
                private :profdata_coverage_files
         | 
| 102 102 |  | 
| 103 | 
            +
                def remove_extension(path)
         | 
| 104 | 
            +
                  path.split(".")[0..-2].join(".")
         | 
| 105 | 
            +
                end
         | 
| 106 | 
            +
             | 
| 107 | 
            +
                def first_product_name
         | 
| 108 | 
            +
                  first_product = self.products.first
         | 
| 109 | 
            +
                  # If name is not available it computes it using
         | 
| 110 | 
            +
                  # the path by dropping the 'extension' of the path.
         | 
| 111 | 
            +
                  first_product.name || remove_extension(first_product.path)
         | 
| 112 | 
            +
                end
         | 
| 113 | 
            +
             | 
| 103 114 | 
             
                def profdata_coverage_dir
         | 
| 104 115 | 
             
                  raise StandardError, "The specified build directory (#{self.build_directory}) does not exist" unless File.exists?(self.build_directory)
         | 
| 105 116 | 
             
                  dir = nil
         | 
| 106 117 | 
             
                  if self.scheme
         | 
| 107 | 
            -
                    dir = Dir["#{build_directory}/**/CodeCoverage/#{self.scheme}"].first
         | 
| 118 | 
            +
                    dir = Dir[File.join("#{build_directory}","/**/CodeCoverage/#{self.scheme}")].first
         | 
| 108 119 | 
             
                  else
         | 
| 109 | 
            -
                    dir = Dir["#{build_directory}/**/#{ | 
| 120 | 
            +
                    dir = Dir[File.join("#{build_directory}","/**/#{first_product_name}")].first
         | 
| 110 121 | 
             
                  end
         | 
| 111 122 |  | 
| 112 123 | 
             
                  raise StandardError, "No coverage directory found. Are you sure your project is setup for generating coverage files? Try `slather setup your/project.xcodeproj`" unless dir != nil
         | 
| @@ -247,17 +258,18 @@ module Slather | |
| 247 258 |  | 
| 248 259 | 
             
                def coverage_service=(service)
         | 
| 249 260 | 
             
                  service = service && service.to_sym
         | 
| 250 | 
            -
                   | 
| 261 | 
            +
                  case service
         | 
| 262 | 
            +
                  when :coveralls
         | 
| 251 263 | 
             
                    extend(Slather::CoverageService::Coveralls)
         | 
| 252 | 
            -
                   | 
| 264 | 
            +
                  when :hardcover
         | 
| 253 265 | 
             
                    extend(Slather::CoverageService::Hardcover)
         | 
| 254 | 
            -
                   | 
| 266 | 
            +
                  when :terminal
         | 
| 255 267 | 
             
                    extend(Slather::CoverageService::SimpleOutput)
         | 
| 256 | 
            -
                   | 
| 268 | 
            +
                  when :gutter_json
         | 
| 257 269 | 
             
                    extend(Slather::CoverageService::GutterJsonOutput)
         | 
| 258 | 
            -
                   | 
| 270 | 
            +
                  when :cobertura_xml
         | 
| 259 271 | 
             
                    extend(Slather::CoverageService::CoberturaXmlOutput)
         | 
| 260 | 
            -
                   | 
| 272 | 
            +
                  when :html
         | 
| 261 273 | 
             
                    extend(Slather::CoverageService::HtmlOutput)
         | 
| 262 274 | 
             
                  else
         | 
| 263 275 | 
             
                    raise ArgumentError, "`#{coverage_service}` is not a valid coverage service. Try `terminal`, `coveralls`, `gutter_json`, `cobertura_xml` or `html`"
         | 
    
        data/lib/slather/version.rb
    CHANGED
    
    
    
        data/slather.gemspec
    CHANGED
    
    | @@ -19,8 +19,8 @@ Gem::Specification.new do |spec| | |
| 19 19 |  | 
| 20 20 | 
             
              spec.add_development_dependency "bundler", "~> 1.6"
         | 
| 21 21 | 
             
              spec.add_development_dependency "coveralls"
         | 
| 22 | 
            -
              spec.add_development_dependency "rake", "~> 10. | 
| 23 | 
            -
              spec.add_development_dependency "rspec", "~> 3. | 
| 22 | 
            +
              spec.add_development_dependency "rake", "~> 10.4"
         | 
| 23 | 
            +
              spec.add_development_dependency "rspec", "~> 3.4"
         | 
| 24 24 | 
             
              spec.add_development_dependency "pry", "~> 0.9"
         | 
| 25 25 | 
             
              spec.add_development_dependency "cocoapods", ">= 0.39.0", "< 1.1.0"
         | 
| 26 26 | 
             
              spec.add_development_dependency "json_spec", "~> 1.1.4"
         | 
| @@ -6,7 +6,7 @@ describe Slather::CoverageFile do | |
| 6 6 | 
             
                project = Slather::Project.open(FIXTURES_PROJECT_PATH)
         | 
| 7 7 | 
             
                project.build_directory = TEMP_DERIVED_DATA_PATH
         | 
| 8 8 | 
             
                project.send(:configure)
         | 
| 9 | 
            -
                project. | 
| 9 | 
            +
                allow(project).to receive(:input_format).and_return("gcov")
         | 
| 10 10 | 
             
                project
         | 
| 11 11 | 
             
              end
         | 
| 12 12 |  | 
| @@ -120,7 +120,7 @@ OBJC | |
| 120 120 | 
             
              describe "line coverage" do
         | 
| 121 121 |  | 
| 122 122 | 
             
                before(:each) {
         | 
| 123 | 
            -
                  fixtures_project. | 
| 123 | 
            +
                  allow(fixtures_project).to receive(:input_format).and_return("gcov")
         | 
| 124 124 | 
             
                }
         | 
| 125 125 |  | 
| 126 126 | 
             
                let(:line_coverage_file) do
         | 
| @@ -157,7 +157,7 @@ OBJC | |
| 157 157 | 
             
                  end
         | 
| 158 158 |  | 
| 159 159 | 
             
                  it "should return 100 if no testable lines" do
         | 
| 160 | 
            -
                    line_coverage_file. | 
| 160 | 
            +
                    allow(line_coverage_file).to receive(:num_lines_testable).and_return(0)
         | 
| 161 161 | 
             
                    expect(line_coverage_file.percentage_lines_tested).to eq(100)
         | 
| 162 162 | 
             
                  end
         | 
| 163 163 | 
             
                end
         | 
| @@ -32,13 +32,13 @@ describe Slather::CoverageService::Coveralls do | |
| 32 32 | 
             
                  before(:each) { fixtures_project.ci_service = :travis_ci }
         | 
| 33 33 |  | 
| 34 34 | 
             
                  it "should return valid json for coveralls coverage gcov data" do
         | 
| 35 | 
            -
                    fixtures_project. | 
| 35 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return("9182")
         | 
| 36 36 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql("{\"service_job_id\":\"9182\",\"service_name\":\"travis-ci\"}").excluding("source_files")
         | 
| 37 37 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql(fixtures_project.send(:coverage_files).map(&:as_json).to_json).at_path("source_files")
         | 
| 38 38 | 
             
                  end
         | 
| 39 39 |  | 
| 40 40 | 
             
                  it "should raise an error if there is no TRAVIS_JOB_ID" do
         | 
| 41 | 
            -
                    fixtures_project. | 
| 41 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return(nil)
         | 
| 42 42 | 
             
                    expect { fixtures_project.send(:coveralls_coverage_data) }.to raise_error(StandardError)
         | 
| 43 43 | 
             
                  end
         | 
| 44 44 | 
             
                end
         | 
| @@ -47,14 +47,14 @@ describe Slather::CoverageService::Coveralls do | |
| 47 47 | 
             
                  before(:each) { fixtures_project.ci_service = :travis_pro }
         | 
| 48 48 |  | 
| 49 49 | 
             
                  it "should return valid json for coveralls coverage data" do
         | 
| 50 | 
            -
                    fixtures_project. | 
| 51 | 
            -
                    fixtures_project. | 
| 50 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return("9182")
         | 
| 51 | 
            +
                    allow(fixtures_project).to receive(:coverage_access_token).and_return("abc123")
         | 
| 52 52 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql("{\"service_job_id\":\"9182\",\"service_name\":\"travis-pro\",\"repo_token\":\"abc123\"}").excluding("source_files")
         | 
| 53 53 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql(fixtures_project.send(:coverage_files).map(&:as_json).to_json).at_path("source_files")
         | 
| 54 54 | 
             
                  end
         | 
| 55 55 |  | 
| 56 56 | 
             
                  it "should raise an error if there is no TRAVIS_JOB_ID" do
         | 
| 57 | 
            -
                    fixtures_project. | 
| 57 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return(nil)
         | 
| 58 58 | 
             
                    expect { fixtures_project.send(:coveralls_coverage_data) }.to raise_error(StandardError)
         | 
| 59 59 | 
             
                  end
         | 
| 60 60 | 
             
                end
         | 
| @@ -63,17 +63,17 @@ describe Slather::CoverageService::Coveralls do | |
| 63 63 | 
             
                  before(:each) { fixtures_project.ci_service = :circleci }
         | 
| 64 64 |  | 
| 65 65 | 
             
                  it "should return valid json for coveralls coverage data" do
         | 
| 66 | 
            -
                    fixtures_project. | 
| 67 | 
            -
                    fixtures_project. | 
| 68 | 
            -
                    fixtures_project. | 
| 69 | 
            -
                    fixtures_project. | 
| 70 | 
            -
                    fixtures_project. | 
| 66 | 
            +
                    allow(fixtures_project).to receive(:circleci_job_id).and_return("9182")
         | 
| 67 | 
            +
                    allow(fixtures_project).to receive(:coverage_access_token).and_return("abc123")
         | 
| 68 | 
            +
                    allow(fixtures_project).to receive(:circleci_pull_request).and_return("1")
         | 
| 69 | 
            +
                    allow(fixtures_project).to receive(:circleci_build_url).and_return("https://circleci.com/gh/Bruce/Wayne/1")
         | 
| 70 | 
            +
                    allow(fixtures_project).to receive(:circleci_git_info).and_return({ :head => { :id => "ababa123", :author_name => "bwayne", :message => "hello" }, :branch => "master" })
         | 
| 71 71 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql("{\"service_job_id\":\"9182\",\"service_name\":\"circleci\",\"repo_token\":\"abc123\",\"service_pull_request\":\"1\",\"service_build_url\":\"https://circleci.com/gh/Bruce/Wayne/1\",\"git\":{\"head\":{\"id\":\"ababa123\",\"author_name\":\"bwayne\",\"message\":\"hello\"},\"branch\":\"master\"}}").excluding("source_files")
         | 
| 72 72 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql(fixtures_project.send(:coverage_files).map(&:as_json).to_json).at_path("source_files")
         | 
| 73 73 | 
             
                  end
         | 
| 74 74 |  | 
| 75 75 | 
             
                  it "should raise an error if there is no CIRCLE_BUILD_NUM" do
         | 
| 76 | 
            -
                    fixtures_project. | 
| 76 | 
            +
                    allow(fixtures_project).to receive(:circleci_job_id).and_return(nil)
         | 
| 77 77 | 
             
                    expect { fixtures_project.send(:coveralls_coverage_data) }.to raise_error(StandardError)
         | 
| 78 78 | 
             
                  end
         | 
| 79 79 | 
             
                end
         | 
| @@ -82,16 +82,16 @@ describe Slather::CoverageService::Coveralls do | |
| 82 82 | 
             
                  before(:each) { fixtures_project.ci_service = :jenkins }
         | 
| 83 83 |  | 
| 84 84 | 
             
                  it "should return valid json for coveralls coverage data" do
         | 
| 85 | 
            -
                    fixtures_project. | 
| 86 | 
            -
                    fixtures_project. | 
| 87 | 
            -
                    fixtures_project. | 
| 88 | 
            -
                    fixtures_project. | 
| 85 | 
            +
                    allow(fixtures_project).to receive(:jenkins_job_id).and_return("9182")
         | 
| 86 | 
            +
                    allow(fixtures_project).to receive(:coverage_access_token).and_return("abc123")
         | 
| 87 | 
            +
                    allow(fixtures_project).to receive(:jenkins_git_info).and_return({head: {id: "master", author_name: "author", message: "pull title" }, branch: "branch"})
         | 
| 88 | 
            +
                    allow(fixtures_project).to receive(:jenkins_branch_name).and_return('master')
         | 
| 89 89 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql("{\"service_job_id\":\"9182\",\"service_name\":\"jenkins\",\"repo_token\":\"abc123\",\"git\":{\"head\":{\"id\":\"master\",\"author_name\":\"author\",\"message\":\"pull title\"},\"branch\":\"branch\"}}").excluding("source_files")
         | 
| 90 90 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql(fixtures_project.send(:coverage_files).map(&:as_json).to_json).at_path("source_files")
         | 
| 91 91 | 
             
                  end
         | 
| 92 92 |  | 
| 93 93 | 
             
                  it "should raise an error if there is no BUILD_ID" do
         | 
| 94 | 
            -
                    fixtures_project. | 
| 94 | 
            +
                    allow(fixtures_project).to receive(:jenkins_job_id).and_return(nil)
         | 
| 95 95 | 
             
                    expect { fixtures_project.send(:coveralls_coverage_data) }.to raise_error(StandardError)
         | 
| 96 96 | 
             
                  end
         | 
| 97 97 | 
             
                end
         | 
| @@ -107,7 +107,7 @@ describe Slather::CoverageService::Coveralls do | |
| 107 107 | 
             
                  before(:each) {
         | 
| 108 108 | 
             
                    fixtures_project.ci_service = :travis_ci
         | 
| 109 109 | 
             
                    project_root = Pathname("./").realpath
         | 
| 110 | 
            -
                    fixtures_project. | 
| 110 | 
            +
                    allow(fixtures_project).to receive(:profdata_llvm_cov_output).and_return("#{project_root}/spec/fixtures/fixtures/fixtures.m:
         | 
| 111 111 | 
             
                   |    1|//
         | 
| 112 112 | 
             
                   |    2|//  fixtures.m
         | 
| 113 113 | 
             
                   |    3|//  fixtures
         | 
| @@ -135,7 +135,7 @@ describe Slather::CoverageService::Coveralls do | |
| 135 135 | 
             
                  }
         | 
| 136 136 |  | 
| 137 137 | 
             
                  it "should save the coveralls_coverage_data to a file and post it to coveralls" do
         | 
| 138 | 
            -
                    fixtures_project. | 
| 138 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return("9182")
         | 
| 139 139 | 
             
                    expect(fixtures_project).to receive(:`) do |cmd|
         | 
| 140 140 | 
             
                      expect(cmd).to eq("curl -s --form json_file=@coveralls_json_file https://coveralls.io/api/v1/jobs")
         | 
| 141 141 | 
             
                      expect(File.read('coveralls_json_file')).to be_json_eql(fixtures_project.send(:coveralls_coverage_data))
         | 
| @@ -144,17 +144,17 @@ describe Slather::CoverageService::Coveralls do | |
| 144 144 | 
             
                  end
         | 
| 145 145 |  | 
| 146 146 | 
             
                  it "should always remove the coveralls_json_file after it's done" do
         | 
| 147 | 
            -
                    fixtures_project. | 
| 148 | 
            -
                    fixtures_project. | 
| 147 | 
            +
                    allow(fixtures_project).to receive(:`)
         | 
| 148 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return("9182")
         | 
| 149 149 | 
             
                    fixtures_project.post
         | 
| 150 150 | 
             
                    expect(File.exist?("coveralls_json_file")).to be_falsy
         | 
| 151 | 
            -
                    fixtures_project. | 
| 151 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return(nil)
         | 
| 152 152 | 
             
                    expect { fixtures_project.post }.to raise_error(StandardError)
         | 
| 153 153 | 
             
                    expect(File.exist?("coveralls_json_file")).to be_falsy
         | 
| 154 154 | 
             
                  end
         | 
| 155 155 |  | 
| 156 156 | 
             
                  it "should return valid json for coveralls coverage profdata data" do
         | 
| 157 | 
            -
                    fixtures_project. | 
| 157 | 
            +
                    allow(fixtures_project).to receive(:travis_job_id).and_return("9182")
         | 
| 158 158 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql("{\"service_job_id\":\"9182\",\"service_name\":\"travis-ci\"}").excluding("source_files")
         | 
| 159 159 | 
             
                    expect(fixtures_project.send(:coveralls_coverage_data)).to be_json_eql(fixtures_project.send(:coverage_files).map(&:as_json).to_json).at_path("source_files")
         | 
| 160 160 | 
             
                  end
         | 
| @@ -38,7 +38,7 @@ describe Slather::CoverageService::Hardcover do | |
| 38 38 | 
             
                context "coverage_service is :jenkins_ci" do
         | 
| 39 39 | 
             
                  before(:each) do
         | 
| 40 40 | 
             
                    fixtures_project.ci_service = :jenkins_ci
         | 
| 41 | 
            -
                    Slather::Project. | 
| 41 | 
            +
                    allow(Slather::Project).to receive(:yml).and_return(fixture_yaml)
         | 
| 42 42 | 
             
                  end
         | 
| 43 43 |  | 
| 44 44 | 
             
                  it "should return a valid json" do
         | 
| @@ -50,7 +50,7 @@ describe Slather::CoverageService::Hardcover do | |
| 50 50 | 
             
                  end
         | 
| 51 51 |  | 
| 52 52 | 
             
                  it "should raise an error if there is no BUILD_NUMBER or JOB_NAME" do
         | 
| 53 | 
            -
                    fixtures_project. | 
| 53 | 
            +
                    allow(fixtures_project).to receive(:jenkins_job_id).and_return(nil)
         | 
| 54 54 | 
             
                    expect { fixtures_project.send(:hardcover_coverage_data) }.to raise_error(StandardError)
         | 
| 55 55 | 
             
                  end
         | 
| 56 56 | 
             
                end
         | 
| @@ -63,10 +63,10 @@ describe Slather::CoverageService::Hardcover do | |
| 63 63 |  | 
| 64 64 | 
             
              describe '#post' do
         | 
| 65 65 | 
             
                before(:each) do
         | 
| 66 | 
            -
                  Slather::Project. | 
| 66 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return(fixture_yaml)
         | 
| 67 67 | 
             
                  fixtures_project.ci_service = :jenkins_ci
         | 
| 68 68 | 
             
                  project_root = Pathname("./").realpath
         | 
| 69 | 
            -
                  fixtures_project. | 
| 69 | 
            +
                  allow(fixtures_project).to receive(:profdata_llvm_cov_output).and_return("#{project_root}/spec/fixtures/fixtures/fixtures.m:
         | 
| 70 70 | 
             
                   |    1|//
         | 
| 71 71 | 
             
                   |    2|//  fixtures.m
         | 
| 72 72 | 
             
                   |    3|//  fixtures
         | 
| @@ -94,8 +94,8 @@ describe Slather::CoverageService::Hardcover do | |
| 94 94 | 
             
                end
         | 
| 95 95 |  | 
| 96 96 | 
             
                it "should save the hardcover_coverage_data to a file and post it to hardcover" do
         | 
| 97 | 
            -
                  fixtures_project. | 
| 98 | 
            -
                  fixtures_project. | 
| 97 | 
            +
                  allow(fixtures_project).to receive(:jenkins_job_id).and_return("slather-master/9182")
         | 
| 98 | 
            +
                  allow(fixtures_project).to receive(:coverage_service_url).and_return("http://api.hardcover.io")
         | 
| 99 99 | 
             
                  expect(fixtures_project).to receive(:`) do |cmd|
         | 
| 100 100 | 
             
                    expect(cmd).to eq("curl --form json_file=@hardcover_json_file http://api.hardcover.io/v1/jobs")
         | 
| 101 101 | 
             
                  end.once
         | 
| @@ -103,13 +103,13 @@ describe Slather::CoverageService::Hardcover do | |
| 103 103 | 
             
                end
         | 
| 104 104 |  | 
| 105 105 | 
             
                it "should always remove the hardcover_json_file after it's done" do
         | 
| 106 | 
            -
                  fixtures_project. | 
| 106 | 
            +
                  allow(fixtures_project).to receive(:`)
         | 
| 107 107 |  | 
| 108 | 
            -
                  fixtures_project. | 
| 109 | 
            -
                  fixtures_project. | 
| 108 | 
            +
                  allow(fixtures_project).to receive(:jenkins_job_id).and_return("slather-master/9182")
         | 
| 109 | 
            +
                  allow(fixtures_project).to receive(:coverage_service_url).and_return("http://api.hardcover.io")
         | 
| 110 110 | 
             
                  fixtures_project.post
         | 
| 111 111 | 
             
                  expect(File.exist?("hardcover_json_file")).to be_falsy
         | 
| 112 | 
            -
                  fixtures_project. | 
| 112 | 
            +
                  allow(fixtures_project).to receive(:jenkins_job_id).and_return(nil)
         | 
| 113 113 | 
             
                  expect { fixtures_project.post }.to raise_error(StandardError)
         | 
| 114 114 | 
             
                  expect(File.exist?("hardcover_json_file")).to be_falsy
         | 
| 115 115 | 
             
                end
         | 
| @@ -30,7 +30,7 @@ describe Slather::CoverageService::HtmlOutput do | |
| 30 30 |  | 
| 31 31 | 
             
              describe '#post' do
         | 
| 32 32 | 
             
                before(:each) {
         | 
| 33 | 
            -
                  fixtures_project. | 
| 33 | 
            +
                  allow(fixtures_project).to receive(:print_path_coverage)
         | 
| 34 34 | 
             
                  fixtures_project.send(:configure)
         | 
| 35 35 | 
             
                }
         | 
| 36 36 |  | 
| @@ -59,7 +59,7 @@ describe Slather::CoverageService::HtmlOutput do | |
| 59 59 | 
             
                end
         | 
| 60 60 |  | 
| 61 61 | 
             
                it "should open the index.html automatically if --show is flagged" do
         | 
| 62 | 
            -
                  fixtures_project. | 
| 62 | 
            +
                  allow(fixtures_project).to receive(:open_coverage)
         | 
| 63 63 |  | 
| 64 64 | 
             
                  fixtures_project.show_html = true
         | 
| 65 65 | 
             
                  fixtures_project.post
         | 
| @@ -180,8 +180,8 @@ describe Slather::CoverageService::HtmlOutput do | |
| 180 180 | 
             
                    (path = doc.at_css('h4.cov_filepath'))? path.text : ""
         | 
| 181 181 | 
             
                  end
         | 
| 182 182 |  | 
| 183 | 
            -
                  fixtures_project. | 
| 184 | 
            -
                  fixtures_project. | 
| 183 | 
            +
                  allow(fixtures_project).to receive(:input_format).and_return("profdata")
         | 
| 184 | 
            +
                  allow(fixtures_project).to receive(:profdata_llvm_cov_output).and_return("./spec/fixtures/fixtures/other_fixtures.m:
         | 
| 185 185 | 
             
                 |    1|//
         | 
| 186 186 | 
             
                 |    2|//  other_fixtures.m
         | 
| 187 187 | 
             
                 |    3|//  fixtures
         | 
| @@ -102,7 +102,7 @@ describe Slather::ProfdataCoverageFile do | |
| 102 102 | 
             
              describe "#ignored" do
         | 
| 103 103 |  | 
| 104 104 | 
             
                before(:each) {
         | 
| 105 | 
            -
                  fixtures_project. | 
| 105 | 
            +
                  allow(fixtures_project).to receive(:ignore_list).and_return([])
         | 
| 106 106 | 
             
                }
         | 
| 107 107 |  | 
| 108 108 | 
             
                it "shouldn't ignore project files" do
         | 
| @@ -52,19 +52,19 @@ describe Slather::Project do | |
| 52 52 | 
             
                end
         | 
| 53 53 |  | 
| 54 54 | 
             
                before(:each) do
         | 
| 55 | 
            -
                  Dir. | 
| 56 | 
            -
                  Dir. | 
| 55 | 
            +
                  allow(Dir).to receive(:[]).and_call_original
         | 
| 56 | 
            +
                  allow(Dir).to receive(:[]).with("#{fixtures_project.build_directory}/**/*.gcno").and_return(["/some/path/fixtures.gcno",
         | 
| 57 57 | 
             
                                                                                              "/some/path/peekaview.gcno",
         | 
| 58 58 | 
             
                                                                                              "/some/path/fixturesTests.gcno",
         | 
| 59 59 | 
             
                                                                                              "/some/path/peekaviewTests.gcno",
         | 
| 60 60 | 
             
                                                                                              "/some/path/NotInProject.gcno",
         | 
| 61 61 | 
             
                                                                                              "/some/path/NSRange.gcno"])
         | 
| 62 | 
            -
                  fixtures_project. | 
| 62 | 
            +
                  allow(fixtures_project).to receive(:coverage_file_class).and_return(SpecCoverageFile)
         | 
| 63 63 | 
             
                end
         | 
| 64 64 |  | 
| 65 65 | 
             
                it "should return coverage file objects of type coverage_file_class for unignored project files" do
         | 
| 66 66 | 
             
                  fixtures_project.ignore_list = ["*fixturesTests*"]
         | 
| 67 | 
            -
                  fixtures_project. | 
| 67 | 
            +
                  allow(fixtures_project).to receive(:dedupe) { |coverage_files| coverage_files }
         | 
| 68 68 | 
             
                  coverage_files = fixtures_project.send(:coverage_files)
         | 
| 69 69 | 
             
                  coverage_files.each { |cf| expect(cf.kind_of?(SpecCoverageFile)).to be_truthy }
         | 
| 70 70 | 
             
                  expect(coverage_files.map { |cf| cf.source_file_pathname.basename.to_s }).to eq(["fixtures.m", "peekaview.m"])
         | 
| @@ -81,9 +81,9 @@ describe Slather::Project do | |
| 81 81 | 
             
                end
         | 
| 82 82 |  | 
| 83 83 | 
             
                before(:each) do
         | 
| 84 | 
            -
                  Dir. | 
| 85 | 
            -
                  Dir. | 
| 86 | 
            -
                  fixtures_project. | 
| 84 | 
            +
                  allow(Dir).to receive(:[]).and_call_original
         | 
| 85 | 
            +
                  allow(Dir).to receive(:[]).with("#{fixtures_project.build_directory}/**/Coverage.profdata").and_return(["/some/path/Coverage.profdata"])
         | 
| 86 | 
            +
                  allow(fixtures_project).to receive(:profdata_llvm_cov_output).and_return("#{FIXTURES_SWIFT_FILE_PATH}:
         | 
| 87 87 | 
             
                   |    0|
         | 
| 88 88 | 
             
                   |    1|import UIKit
         | 
| 89 89 | 
             
                   |    2|
         | 
| @@ -99,8 +99,8 @@ describe Slather::Project do | |
| 99 99 | 
             
                  0|   12|    func applicationWillResignActive(application: UIApplication) {
         | 
| 100 100 | 
             
                  0|   13|    }
         | 
| 101 101 | 
             
                  0|   14|}")
         | 
| 102 | 
            -
                  fixtures_project. | 
| 103 | 
            -
                  fixtures_project. | 
| 102 | 
            +
                  allow(fixtures_project).to receive(:coverage_file_class).and_return(SpecXcode7CoverageFile)
         | 
| 103 | 
            +
                  allow(fixtures_project).to receive(:ignore_list).and_return([])
         | 
| 104 104 | 
             
                end
         | 
| 105 105 |  | 
| 106 106 | 
             
                it "should return Coverage.profdata file objects" do
         | 
| @@ -110,7 +110,7 @@ describe Slather::Project do | |
| 110 110 | 
             
                end
         | 
| 111 111 |  | 
| 112 112 | 
             
                it "should ignore files from the ignore list" do
         | 
| 113 | 
            -
                  fixtures_project. | 
| 113 | 
            +
                  allow(fixtures_project).to receive(:ignore_list).and_return(["**/Fixtures.swift"])
         | 
| 114 114 | 
             
                  profdata_coverage_files = fixtures_project.send(:profdata_coverage_files)
         | 
| 115 115 | 
             
                  expect(profdata_coverage_files.count).to eq(0)
         | 
| 116 116 | 
             
                end
         | 
| @@ -118,10 +118,10 @@ describe Slather::Project do | |
| 118 118 |  | 
| 119 119 | 
             
              describe "#invalid_characters" do
         | 
| 120 120 | 
             
                it "should correctly encode invalid characters" do
         | 
| 121 | 
            -
                  fixtures_project. | 
| 122 | 
            -
                  fixtures_project. | 
| 123 | 
            -
                  Dir. | 
| 124 | 
            -
                  fixtures_project. | 
| 121 | 
            +
                  allow(fixtures_project).to receive(:input_format).and_return("profdata")
         | 
| 122 | 
            +
                  allow(fixtures_project).to receive(:ignore_list).and_return([])
         | 
| 123 | 
            +
                  allow(Dir).to receive(:[]).with("#{fixtures_project.build_directory}/**/Coverage.profdata").and_return(["/some/path/Coverage.profdata"])
         | 
| 124 | 
            +
                  allow(fixtures_project).to receive(:unsafe_profdata_llvm_cov_output).and_return("#{FIXTURES_SWIFT_FILE_PATH}:
         | 
| 125 125 | 
             
                  1|    8|    func application(application: \255, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
         | 
| 126 126 | 
             
                  1|    9|        return true
         | 
| 127 127 | 
             
                  0|   14|}")
         | 
| @@ -138,31 +138,31 @@ describe Slather::Project do | |
| 138 138 | 
             
                end
         | 
| 139 139 |  | 
| 140 140 | 
             
                before(:each) do
         | 
| 141 | 
            -
                  Dir. | 
| 142 | 
            -
                  fixtures_project. | 
| 143 | 
            -
                  fixtures_project. | 
| 144 | 
            -
                  fixtures_project. | 
| 145 | 
            -
                  Dir. | 
| 146 | 
            -
                  Dir. | 
| 141 | 
            +
                  allow(Dir).to receive(:[]).and_call_original
         | 
| 142 | 
            +
                  allow(fixtures_project).to receive(:build_directory).and_return(build_directory)
         | 
| 143 | 
            +
                  allow(fixtures_project).to receive(:input_format).and_return("profdata")
         | 
| 144 | 
            +
                  allow(fixtures_project).to receive(:scheme).and_return("FixtureScheme")
         | 
| 145 | 
            +
                  allow(Dir).to receive(:[]).with("#{build_directory}/**/CodeCoverage/FixtureScheme").and_return(["#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme"])
         | 
| 146 | 
            +
                  allow(Dir).to receive(:[]).with("#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme/**/*.xctest").and_return(["#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme/FixtureAppTests.xctest"])
         | 
| 147 147 | 
             
                end
         | 
| 148 148 |  | 
| 149 149 | 
             
                it "should return the binary file location for an app bundle provided a scheme" do
         | 
| 150 | 
            -
                  Dir. | 
| 151 | 
            -
                  Dir. | 
| 150 | 
            +
                  allow(Dir).to receive(:[]).with("#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme/*.app").and_return(["/FixtureScheme/FixtureApp.app"])
         | 
| 151 | 
            +
                  allow(Dir).to receive(:[]).with("/FixtureScheme/FixtureApp.app/**/FixtureApp").and_return(["/FixtureScheme/FixtureApp.app/FixtureApp"])
         | 
| 152 152 | 
             
                  fixtures_project.send(:configure_binary_file)
         | 
| 153 153 | 
             
                  binary_file_location = fixtures_project.send(:binary_file)
         | 
| 154 154 | 
             
                  expect(binary_file_location).to eq("/FixtureScheme/FixtureApp.app/FixtureApp")
         | 
| 155 155 | 
             
                end
         | 
| 156 156 |  | 
| 157 157 | 
             
                it "should return the binary file location for a framework bundle provided a scheme" do
         | 
| 158 | 
            -
                  Dir. | 
| 158 | 
            +
                  allow(Dir).to receive(:[]).with("#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme/*.framework").and_return(["/FixtureScheme/FixtureFramework.framework"])
         | 
| 159 159 | 
             
                  fixtures_project.send(:configure_binary_file)
         | 
| 160 160 | 
             
                  binary_file_location = fixtures_project.send(:binary_file)
         | 
| 161 161 | 
             
                  expect(binary_file_location).to eq("/FixtureScheme/FixtureFramework.framework/FixtureFramework")
         | 
| 162 162 | 
             
                end
         | 
| 163 163 |  | 
| 164 164 | 
             
                it "should return the binary file location for a test bundle provided a scheme" do
         | 
| 165 | 
            -
                  Dir. | 
| 165 | 
            +
                  allow(Dir).to receive(:[]).with("#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme/FixtureAppTests.xctest/**/FixtureAppTests").and_return(["/FixtureScheme/FixtureAppTests.xctest/Contents/MacOS/FixtureAppTests"])
         | 
| 166 166 | 
             
                  fixtures_project.send(:configure_binary_file)
         | 
| 167 167 | 
             
                  binary_file_location = fixtures_project.send(:binary_file)
         | 
| 168 168 | 
             
                  expect(binary_file_location).to eq("/FixtureScheme/FixtureAppTests.xctest/Contents/MacOS/FixtureAppTests")
         | 
| @@ -176,7 +176,7 @@ describe Slather::Project do | |
| 176 176 | 
             
                end
         | 
| 177 177 |  | 
| 178 178 | 
             
                it "should configure the binary_file from yml" do
         | 
| 179 | 
            -
                  Slather::Project. | 
| 179 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return(fixture_yaml)
         | 
| 180 180 | 
             
                  fixtures_project.send(:configure_binary_file)
         | 
| 181 181 | 
             
                  binary_file_location = fixtures_project.send(:binary_file)
         | 
| 182 182 | 
             
                  expect(binary_file_location).to eq("/FixtureScheme/From/Yaml/Contents/MacOS/FixturesFromYaml")
         | 
| @@ -190,8 +190,8 @@ describe Slather::Project do | |
| 190 190 | 
             
                end
         | 
| 191 191 |  | 
| 192 192 | 
             
                it "should configure the binary_basename from yml" do
         | 
| 193 | 
            -
                  Slather::Project. | 
| 194 | 
            -
                  Dir. | 
| 193 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return(other_fixture_yaml)
         | 
| 194 | 
            +
                  allow(Dir).to receive(:[]).with("#{build_directory}/Build/Intermediates/CodeCoverage/FixtureScheme/FixtureFramework.framework").and_return(["/FixtureScheme/FixtureFramework.framework"])
         | 
| 195 195 | 
             
                  fixtures_project.send(:configure_binary_file)
         | 
| 196 196 | 
             
                  binary_file_location = fixtures_project.send(:binary_file)
         | 
| 197 197 | 
             
                  expect(binary_file_location).to eq("/FixtureScheme/FixtureFramework.framework/FixtureFramework")
         | 
| @@ -209,16 +209,16 @@ describe Slather::Project do | |
| 209 209 | 
             
              describe "#dedupe" do
         | 
| 210 210 | 
             
                it "should return a deduplicated list of coverage files, favoring the file with higher coverage" do
         | 
| 211 211 | 
             
                  coverage_file_1 = double(Slather::CoverageFile)
         | 
| 212 | 
            -
                  coverage_file_1. | 
| 213 | 
            -
                  coverage_file_1. | 
| 212 | 
            +
                  allow(coverage_file_1).to receive(:source_file_pathname).and_return("some/path/class1.m")
         | 
| 213 | 
            +
                  allow(coverage_file_1).to receive(:percentage_lines_tested).and_return(100)
         | 
| 214 214 |  | 
| 215 215 | 
             
                  coverage_file_2 = double(Slather::CoverageFile)
         | 
| 216 | 
            -
                  coverage_file_2. | 
| 217 | 
            -
                  coverage_file_2. | 
| 216 | 
            +
                  allow(coverage_file_2).to receive(:source_file_pathname).and_return("some/path/class2.m")
         | 
| 217 | 
            +
                  allow(coverage_file_2).to receive(:percentage_lines_tested).and_return(100)
         | 
| 218 218 |  | 
| 219 219 | 
             
                  coverage_file_2b = double(Slather::CoverageFile)
         | 
| 220 | 
            -
                  coverage_file_2b. | 
| 221 | 
            -
                  coverage_file_2b. | 
| 220 | 
            +
                  allow(coverage_file_2b).to receive(:source_file_pathname).and_return("some/path/class2.m")
         | 
| 221 | 
            +
                  allow(coverage_file_2b).to receive(:percentage_lines_tested).and_return(0)
         | 
| 222 222 |  | 
| 223 223 | 
             
                  coverage_files = [coverage_file_1, coverage_file_2, coverage_file_2b]
         | 
| 224 224 | 
             
                  deduped_coverage_files = fixtures_project.send(:dedupe, coverage_files)
         | 
| @@ -244,26 +244,26 @@ describe Slather::Project do | |
| 244 244 |  | 
| 245 245 | 
             
              describe "#configure_ignore_list" do
         | 
| 246 246 | 
             
                it "should set the ignore_list if it has been provided in the yml and has not already been set" do
         | 
| 247 | 
            -
                  Slather::Project. | 
| 247 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"ignore" => ["test", "ing"] })
         | 
| 248 248 | 
             
                  fixtures_project.configure_ignore_list
         | 
| 249 249 | 
             
                  expect(fixtures_project.ignore_list).to eq(["test", "ing"])
         | 
| 250 250 | 
             
                end
         | 
| 251 251 |  | 
| 252 252 | 
             
                it "should force the ignore_list into an array" do
         | 
| 253 | 
            -
                  Slather::Project. | 
| 253 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"ignore" => "test" })
         | 
| 254 254 | 
             
                  fixtures_project.configure_ignore_list
         | 
| 255 255 | 
             
                  expect(fixtures_project.ignore_list).to eq(["test"])
         | 
| 256 256 | 
             
                end
         | 
| 257 257 |  | 
| 258 258 | 
             
                it "should not set the ignore_list if it has already been set" do
         | 
| 259 | 
            -
                  Slather::Project. | 
| 259 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"ignore" => ["test", "ing"] })
         | 
| 260 260 | 
             
                  fixtures_project.ignore_list = ["already", "set"]
         | 
| 261 261 | 
             
                  fixtures_project.configure_ignore_list
         | 
| 262 262 | 
             
                  expect(fixtures_project.ignore_list).to eq(["already", "set"])
         | 
| 263 263 | 
             
                end
         | 
| 264 264 |  | 
| 265 265 | 
             
                it "should default the ignore_list to an empty array if nothing is provided in the yml" do
         | 
| 266 | 
            -
                  Slather::Project. | 
| 266 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({})
         | 
| 267 267 | 
             
                  fixtures_project.configure_ignore_list
         | 
| 268 268 | 
             
                  expect(fixtures_project.ignore_list).to eq([])
         | 
| 269 269 | 
             
                end
         | 
| @@ -271,20 +271,20 @@ describe Slather::Project do | |
| 271 271 |  | 
| 272 272 | 
             
              describe "#configure_build_directory" do
         | 
| 273 273 | 
             
                it "should set the build_directory if it has been provided in the yml and has not already been set" do
         | 
| 274 | 
            -
                  Slather::Project. | 
| 274 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"build_directory" => "/some/path"})
         | 
| 275 275 | 
             
                  fixtures_project.configure_build_directory
         | 
| 276 276 | 
             
                  expect(fixtures_project.build_directory).to eq("/some/path")
         | 
| 277 277 | 
             
                end
         | 
| 278 278 |  | 
| 279 279 | 
             
                it "should not set the build_directory if it has already been set" do
         | 
| 280 | 
            -
                  Slather::Project. | 
| 280 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"build_directory" => "/some/path"})
         | 
| 281 281 | 
             
                  fixtures_project.build_directory = "/already/set"
         | 
| 282 282 | 
             
                  fixtures_project.configure_build_directory
         | 
| 283 283 | 
             
                  expect(fixtures_project.build_directory).to eq("/already/set")
         | 
| 284 284 | 
             
                end
         | 
| 285 285 |  | 
| 286 286 | 
             
                it "should default the build_directory to derived data if nothing is provided in the yml" do
         | 
| 287 | 
            -
                  Slather::Project. | 
| 287 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({})
         | 
| 288 288 | 
             
                  fixtures_project.configure_build_directory
         | 
| 289 289 | 
             
                  expect(fixtures_project.build_directory).to eq(fixtures_project.send(:derived_data_path))
         | 
| 290 290 | 
             
                end
         | 
| @@ -292,13 +292,13 @@ describe Slather::Project do | |
| 292 292 |  | 
| 293 293 | 
             
              describe "#configure_source_directory" do
         | 
| 294 294 | 
             
                it "should set the source_directory if it has been provided in the yml and has not already been set" do
         | 
| 295 | 
            -
                  Slather::Project. | 
| 295 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"source_directory" => "/some/path"})
         | 
| 296 296 | 
             
                  fixtures_project.configure_source_directory
         | 
| 297 297 | 
             
                  expect(fixtures_project.source_directory).to eq("/some/path")
         | 
| 298 298 | 
             
                end
         | 
| 299 299 |  | 
| 300 300 | 
             
                it "should not set the source_directory if it has already been set" do
         | 
| 301 | 
            -
                  Slather::Project. | 
| 301 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"source_directory" => "/some/path"})
         | 
| 302 302 | 
             
                  fixtures_project.source_directory = "/already/set"
         | 
| 303 303 | 
             
                  fixtures_project.configure_source_directory
         | 
| 304 304 | 
             
                  expect(fixtures_project.source_directory).to eq("/already/set")
         | 
| @@ -307,13 +307,13 @@ describe Slather::Project do | |
| 307 307 |  | 
| 308 308 | 
             
              describe "#configure_output_directory" do
         | 
| 309 309 | 
             
                it "should set the output_directory if it has been provided in the yml and has not already been set" do
         | 
| 310 | 
            -
                  Slather::Project. | 
| 310 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"output_directory" => "/some/path"})
         | 
| 311 311 | 
             
                  fixtures_project.configure_output_directory
         | 
| 312 312 | 
             
                  expect(fixtures_project.output_directory).to eq("/some/path")
         | 
| 313 313 | 
             
                end
         | 
| 314 314 |  | 
| 315 315 | 
             
                it "should not set the output_directory if it has already been set" do
         | 
| 316 | 
            -
                  Slather::Project. | 
| 316 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"output_directory" => "/some/path"})
         | 
| 317 317 | 
             
                  fixtures_project.output_directory = "/already/set"
         | 
| 318 318 | 
             
                  fixtures_project.configure_output_directory
         | 
| 319 319 | 
             
                  expect(fixtures_project.output_directory).to eq("/already/set")
         | 
| @@ -322,20 +322,20 @@ describe Slather::Project do | |
| 322 322 |  | 
| 323 323 | 
             
              describe "#configure_ci_service" do
         | 
| 324 324 | 
             
                it "should set the ci_service if it has been provided in the yml and has not already been set" do
         | 
| 325 | 
            -
                  Slather::Project. | 
| 325 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"ci_service" => "some_service"})
         | 
| 326 326 | 
             
                  fixtures_project.configure_ci_service
         | 
| 327 327 | 
             
                  expect(fixtures_project.ci_service).to eq(:some_service)
         | 
| 328 328 | 
             
                end
         | 
| 329 329 |  | 
| 330 330 | 
             
                it "should not set the ci_service if it has already been set" do
         | 
| 331 | 
            -
                  Slather::Project. | 
| 331 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"ci_service" => "some service"})
         | 
| 332 332 | 
             
                  fixtures_project.ci_service = "already_set"
         | 
| 333 333 | 
             
                  fixtures_project.configure_ci_service
         | 
| 334 334 | 
             
                  expect(fixtures_project.ci_service).to eq(:already_set)
         | 
| 335 335 | 
             
                end
         | 
| 336 336 |  | 
| 337 337 | 
             
                it "should default the ci_service to :travis_ci if nothing is provided in the yml" do
         | 
| 338 | 
            -
                  Slather::Project. | 
| 338 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({})
         | 
| 339 339 | 
             
                  fixtures_project.configure_ci_service
         | 
| 340 340 | 
             
                  expect(fixtures_project.ci_service).to eq(:travis_ci)
         | 
| 341 341 | 
             
                end
         | 
| @@ -350,20 +350,20 @@ describe Slather::Project do | |
| 350 350 |  | 
| 351 351 | 
             
              describe "#configure_coverage_service" do
         | 
| 352 352 | 
             
                it "should set the coverage_service if it has been provided by the yml" do
         | 
| 353 | 
            -
                  Slather::Project. | 
| 353 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"coverage_service" => "some_service"})
         | 
| 354 354 | 
             
                  expect(fixtures_project).to receive(:coverage_service=).with("some_service")
         | 
| 355 355 | 
             
                  fixtures_project.configure_coverage_service
         | 
| 356 356 | 
             
                end
         | 
| 357 357 |  | 
| 358 358 | 
             
                it "should default the coverage_service to :terminal if nothing is provided in the yml" do
         | 
| 359 | 
            -
                  Slather::Project. | 
| 359 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({})
         | 
| 360 360 | 
             
                  expect(fixtures_project).to receive(:coverage_service=).with(:terminal)
         | 
| 361 361 | 
             
                  fixtures_project.configure_coverage_service
         | 
| 362 362 | 
             
                end
         | 
| 363 363 |  | 
| 364 364 | 
             
                it "should not set the coverage_service if it has already been set" do
         | 
| 365 | 
            -
                  Slather::Project. | 
| 366 | 
            -
                  fixtures_project. | 
| 365 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"coverage_service" => "some_service" })
         | 
| 366 | 
            +
                  allow(fixtures_project).to receive(:coverage_service).and_return("already set")
         | 
| 367 367 | 
             
                  expect(fixtures_project).to_not receive(:coverage_service=)
         | 
| 368 368 | 
             
                  fixtures_project.configure_coverage_service
         | 
| 369 369 | 
             
                end
         | 
| @@ -371,17 +371,17 @@ describe Slather::Project do | |
| 371 371 |  | 
| 372 372 | 
             
              describe "#configure_coverage_access_token" do
         | 
| 373 373 | 
             
                it "should set the coverage_access_token if it has been provided by the yml" do
         | 
| 374 | 
            -
                  Slather::Project. | 
| 374 | 
            +
                  allow(Slather::Project).to receive(:yml).and_return({"coverage_access_token" => "abc123"})
         | 
| 375 375 | 
             
                  expect(fixtures_project).to receive(:coverage_access_token=).with("abc123")
         | 
| 376 376 | 
             
                  fixtures_project.configure_coverage_access_token
         | 
| 377 377 | 
             
                end
         | 
| 378 | 
            -
             | 
| 378 | 
            +
             | 
| 379 379 | 
             
                it "should set the coverage_access_token if it is in the ENV" do
         | 
| 380 380 | 
             
                  stub_const('ENV', ENV.to_hash.merge('COVERAGE_ACCESS_TOKEN' => 'asdf456'))
         | 
| 381 381 | 
             
                  expect(fixtures_project).to receive(:coverage_access_token=).with("asdf456")
         | 
| 382 382 | 
             
                  fixtures_project.configure_coverage_access_token
         | 
| 383 383 | 
             
                end
         | 
| 384 | 
            -
             | 
| 384 | 
            +
             | 
| 385 385 | 
             
              end
         | 
| 386 386 |  | 
| 387 387 | 
             
              describe "#coverage_service=" do
         | 
| @@ -406,7 +406,7 @@ describe Slather::Project do | |
| 406 406 |  | 
| 407 407 | 
             
                let(:fixtures_project_setup) do
         | 
| 408 408 | 
             
                  FileUtils.cp_r "#{FIXTURES_PROJECT_PATH}/", "#{FIXTURES_PROJECT_SETUP_PATH}/"
         | 
| 409 | 
            -
                  Slather::Project. | 
| 409 | 
            +
                  allow_any_instance_of(Slather::Project).to receive(:configure)
         | 
| 410 410 | 
             
                  Slather::Project.open(FIXTURES_PROJECT_SETUP_PATH)
         | 
| 411 411 | 
             
                end
         | 
| 412 412 |  | 
| @@ -449,8 +449,8 @@ describe Slather::Project do | |
| 449 449 |  | 
| 450 450 | 
             
                  project_root = Pathname("./").realpath
         | 
| 451 451 |  | 
| 452 | 
            -
                  ["\nProcessing coverage file: #{project_root}/spec/DerivedData/Build/Intermediates/CodeCoverage/fixtures/Coverage.profdata",
         | 
| 453 | 
            -
                   "Against binary file: #{project_root}/spec/DerivedData/Build/Intermediates/CodeCoverage/fixtures/Products/Debug/fixturesTests.xctest/Contents/MacOS/fixturesTests\n\n"
         | 
| 452 | 
            +
                  ["\nProcessing coverage file: #{project_root}/spec/DerivedData/libfixtures/Build/Intermediates/CodeCoverage/fixtures/Coverage.profdata",
         | 
| 453 | 
            +
                   "Against binary file: #{project_root}/spec/DerivedData/libfixtures/Build/Intermediates/CodeCoverage/fixtures/Products/Debug/fixturesTests.xctest/Contents/MacOS/fixturesTests\n\n"
         | 
| 454 454 | 
             
                  ].each do |line|
         | 
| 455 455 | 
             
                    expect(fixtures_project).to receive(:puts).with(line)
         | 
| 456 456 | 
             
                  end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -12,7 +12,8 @@ FIXTURES_JSON_PATH = File.join(File.dirname(__FILE__), 'fixtures/gutter.json') | |
| 12 12 | 
             
            FIXTURES_HTML_FOLDER_PATH = File.join(File.dirname(__FILE__), 'fixtures/fixtures_html')
         | 
| 13 13 | 
             
            FIXTURES_PROJECT_PATH = File.join(File.dirname(__FILE__), 'fixtures/fixtures.xcodeproj')
         | 
| 14 14 | 
             
            FIXTURES_SWIFT_FILE_PATH = File.join(File.dirname(__FILE__), 'fixtures/fixtures/Fixtures.swift')
         | 
| 15 | 
            -
            TEMP_DERIVED_DATA_PATH = File.join(File.dirname(__FILE__), 'DerivedData | 
| 15 | 
            +
            TEMP_DERIVED_DATA_PATH = File.join(File.dirname(__FILE__), 'DerivedData')
         | 
| 16 | 
            +
            TEMP_PROJECT_BUILD_PATH = File.join(TEMP_DERIVED_DATA_PATH, "libfixtures")
         | 
| 16 17 | 
             
            TEMP_OBJC_GCNO_PATH = File.join(File.dirname(__FILE__), 'fixtures/ObjectiveC.gcno')
         | 
| 17 18 | 
             
            TEMP_OBJC_GCDA_PATH = File.join(File.dirname(__FILE__), 'fixtures/ObjectiveC.gcda')
         | 
| 18 19 |  | 
| @@ -39,7 +40,7 @@ RSpec.configure do |config| | |
| 39 40 | 
             
              config.before(:suite) do
         | 
| 40 41 | 
             
                FixtureHelpers.delete_derived_data
         | 
| 41 42 | 
             
                FixtureHelpers.delete_temp_gcov_files
         | 
| 42 | 
            -
                `xcodebuild -project "#{FIXTURES_PROJECT_PATH}" -scheme fixtures -configuration Debug -derivedDataPath #{ | 
| 43 | 
            +
                `xcodebuild -project "#{FIXTURES_PROJECT_PATH}" -scheme fixtures -configuration Debug -derivedDataPath #{TEMP_PROJECT_BUILD_PATH} -enableCodeCoverage YES clean test`
         | 
| 43 44 | 
             
              end
         | 
| 44 45 |  | 
| 45 46 | 
             
              config.after(:suite) do
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: slather
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.0. | 
| 4 | 
            +
              version: 2.0.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Mark Larsen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-02- | 
| 11 | 
            +
            date: 2016-02-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -44,28 +44,28 @@ dependencies: | |
| 44 44 | 
             
                requirements:
         | 
| 45 45 | 
             
                - - ~>
         | 
| 46 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            -
                    version: '10. | 
| 47 | 
            +
                    version: '10.4'
         | 
| 48 48 | 
             
              type: :development
         | 
| 49 49 | 
             
              prerelease: false
         | 
| 50 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 52 | 
             
                - - ~>
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version: '10. | 
| 54 | 
            +
                    version: '10.4'
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 56 | 
             
              name: rspec
         | 
| 57 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 58 58 | 
             
                requirements:
         | 
| 59 59 | 
             
                - - ~>
         | 
| 60 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: '3. | 
| 61 | 
            +
                    version: '3.4'
         | 
| 62 62 | 
             
              type: :development
         | 
| 63 63 | 
             
              prerelease: false
         | 
| 64 64 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 65 65 | 
             
                requirements:
         | 
| 66 66 | 
             
                - - ~>
         | 
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 | 
            -
                    version: '3. | 
| 68 | 
            +
                    version: '3.4'
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 70 | 
             
              name: pry
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         |