danger-xccov_summary 0.0.7
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 +7 -0
- data/.rubocop.yml +2 -0
- data/.yardoc/checksums +4 -0
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +134 -0
- data/Guardfile +19 -0
- data/LICENSE.txt +13 -0
- data/README.md +30 -0
- data/Rakefile +23 -0
- data/danger-xccov_summary.gemspec +49 -0
- data/lib/danger_plugin.rb +1 -0
- data/lib/danger_xccov_summary.rb +1 -0
- data/lib/xccov_summary/gem_version.rb +3 -0
- data/lib/xccov_summary/plugin.rb +67 -0
- data/pkg/danger-xccov_summary-0.0.1.gem +0 -0
- data/spec/spec_helper.rb +65 -0
- data/spec/xccov_summary_spec.rb +25 -0
- metadata +206 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: cc1ff235a1007c5ca9867d5c1f9d47c94e553a940481f2b7bb10448e8ddc062b
|
|
4
|
+
data.tar.gz: 850e573e050727e116a33ed196695b75ffa8c7259dea71e3d7d250608a581370
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: '08186c58944a085eb14beff82a9922af2db4967b3660323634a58348ddbdc79db5ed782f26a2165f13c26802f761c788e3a0dfd35ffe458cb54e6d0845737c77'
|
|
7
|
+
data.tar.gz: 163f3f5335188494cf1c94c238a9ad7b27c7b637d46a894a19d7a3526f4c1985e6362fb7ed1fde44a801cfb012bf16b0384d3f37650f991c0f9ba28ffa591300
|
data/.rubocop.yml
ADDED
data/.yardoc/checksums
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/Users/taylor.ledingham/dev/xccov-summary/lib/danger_plugin.rb 4513d492d2e564d195467d85a5f30d504900bf71
|
|
2
|
+
/Users/taylor.ledingham/dev/xccov-summary/lib/xccov_summary/gem_version.rb 149d6852d4b67ad013804282329e1710dcd3ad91
|
|
3
|
+
/Users/taylor.ledingham/dev/xccov-summary/lib/xccov_summary/plugin.rb f02350d748e3a824a2c009cf7a781a5702b3ee43
|
|
4
|
+
/Users/taylor.ledingham/dev/xccov-summary/lib/danger_xccov_summary.rb dc27021b9601fe654563c3525688abe17b632775
|
data/.yardoc/complete
ADDED
|
File without changes
|
|
Binary file
|
|
Binary file
|
data/.yardoc/proxy_types
ADDED
|
Binary file
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
danger-xccov_summary (0.0.7)
|
|
5
|
+
danger-plugin-api (~> 1.0)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: https://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
addressable (2.5.2)
|
|
11
|
+
public_suffix (>= 2.0.2, < 4.0)
|
|
12
|
+
ast (2.4.0)
|
|
13
|
+
claide (1.0.2)
|
|
14
|
+
claide-plugins (0.9.2)
|
|
15
|
+
cork
|
|
16
|
+
nap
|
|
17
|
+
open4 (~> 1.3)
|
|
18
|
+
coderay (1.1.2)
|
|
19
|
+
colored2 (3.1.2)
|
|
20
|
+
cork (0.3.0)
|
|
21
|
+
colored2 (~> 3.1)
|
|
22
|
+
danger (5.6.2)
|
|
23
|
+
claide (~> 1.0)
|
|
24
|
+
claide-plugins (>= 0.9.2)
|
|
25
|
+
colored2 (~> 3.1)
|
|
26
|
+
cork (~> 0.1)
|
|
27
|
+
faraday (~> 0.9)
|
|
28
|
+
faraday-http-cache (~> 1.0)
|
|
29
|
+
git (~> 1)
|
|
30
|
+
kramdown (~> 1.5)
|
|
31
|
+
no_proxy_fix
|
|
32
|
+
octokit (~> 4.7)
|
|
33
|
+
terminal-table (~> 1)
|
|
34
|
+
danger-plugin-api (1.0.0)
|
|
35
|
+
danger (> 2.0)
|
|
36
|
+
diff-lcs (1.3)
|
|
37
|
+
faraday (0.15.2)
|
|
38
|
+
multipart-post (>= 1.2, < 3)
|
|
39
|
+
faraday-http-cache (1.3.1)
|
|
40
|
+
faraday (~> 0.8)
|
|
41
|
+
ffi (1.9.25)
|
|
42
|
+
formatador (0.2.5)
|
|
43
|
+
git (1.4.0)
|
|
44
|
+
guard (2.14.2)
|
|
45
|
+
formatador (>= 0.2.4)
|
|
46
|
+
listen (>= 2.7, < 4.0)
|
|
47
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
48
|
+
nenv (~> 0.1)
|
|
49
|
+
notiffany (~> 0.0)
|
|
50
|
+
pry (>= 0.9.12)
|
|
51
|
+
shellany (~> 0.0)
|
|
52
|
+
thor (>= 0.18.1)
|
|
53
|
+
guard-compat (1.2.1)
|
|
54
|
+
guard-rspec (4.7.3)
|
|
55
|
+
guard (~> 2.1)
|
|
56
|
+
guard-compat (~> 1.1)
|
|
57
|
+
rspec (>= 2.99.0, < 4.0)
|
|
58
|
+
kramdown (1.17.0)
|
|
59
|
+
listen (3.0.7)
|
|
60
|
+
rb-fsevent (>= 0.9.3)
|
|
61
|
+
rb-inotify (>= 0.9.7)
|
|
62
|
+
lumberjack (1.0.13)
|
|
63
|
+
method_source (0.9.0)
|
|
64
|
+
multipart-post (2.0.0)
|
|
65
|
+
nap (1.1.0)
|
|
66
|
+
nenv (0.3.0)
|
|
67
|
+
no_proxy_fix (0.1.2)
|
|
68
|
+
notiffany (0.1.1)
|
|
69
|
+
nenv (~> 0.1)
|
|
70
|
+
shellany (~> 0.0)
|
|
71
|
+
octokit (4.9.0)
|
|
72
|
+
sawyer (~> 0.8.0, >= 0.5.3)
|
|
73
|
+
open4 (1.3.4)
|
|
74
|
+
parallel (1.12.1)
|
|
75
|
+
parser (2.5.1.0)
|
|
76
|
+
ast (~> 2.4.0)
|
|
77
|
+
powerpack (0.1.1)
|
|
78
|
+
pry (0.11.3)
|
|
79
|
+
coderay (~> 1.1.0)
|
|
80
|
+
method_source (~> 0.9.0)
|
|
81
|
+
public_suffix (3.0.2)
|
|
82
|
+
rainbow (3.0.0)
|
|
83
|
+
rake (10.5.0)
|
|
84
|
+
rb-fsevent (0.10.3)
|
|
85
|
+
rb-inotify (0.9.10)
|
|
86
|
+
ffi (>= 0.5.0, < 2)
|
|
87
|
+
rspec (3.7.0)
|
|
88
|
+
rspec-core (~> 3.7.0)
|
|
89
|
+
rspec-expectations (~> 3.7.0)
|
|
90
|
+
rspec-mocks (~> 3.7.0)
|
|
91
|
+
rspec-core (3.7.1)
|
|
92
|
+
rspec-support (~> 3.7.0)
|
|
93
|
+
rspec-expectations (3.7.0)
|
|
94
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
95
|
+
rspec-support (~> 3.7.0)
|
|
96
|
+
rspec-mocks (3.7.0)
|
|
97
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
98
|
+
rspec-support (~> 3.7.0)
|
|
99
|
+
rspec-support (3.7.1)
|
|
100
|
+
rubocop (0.56.0)
|
|
101
|
+
parallel (~> 1.10)
|
|
102
|
+
parser (>= 2.5)
|
|
103
|
+
powerpack (~> 0.1)
|
|
104
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
105
|
+
ruby-progressbar (~> 1.7)
|
|
106
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
|
107
|
+
ruby-progressbar (1.9.0)
|
|
108
|
+
sawyer (0.8.1)
|
|
109
|
+
addressable (>= 2.3.5, < 2.6)
|
|
110
|
+
faraday (~> 0.8, < 1.0)
|
|
111
|
+
shellany (0.0.1)
|
|
112
|
+
terminal-table (1.8.0)
|
|
113
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
|
114
|
+
thor (0.20.0)
|
|
115
|
+
unicode-display_width (1.4.0)
|
|
116
|
+
yard (0.9.14)
|
|
117
|
+
|
|
118
|
+
PLATFORMS
|
|
119
|
+
ruby
|
|
120
|
+
|
|
121
|
+
DEPENDENCIES
|
|
122
|
+
bundler (~> 1.3)
|
|
123
|
+
danger-xccov_summary!
|
|
124
|
+
guard (~> 2.14)
|
|
125
|
+
guard-rspec (~> 4.7)
|
|
126
|
+
listen (= 3.0.7)
|
|
127
|
+
pry
|
|
128
|
+
rake (~> 10.0)
|
|
129
|
+
rspec (~> 3.4)
|
|
130
|
+
rubocop
|
|
131
|
+
yard
|
|
132
|
+
|
|
133
|
+
BUNDLED WITH
|
|
134
|
+
1.16.1
|
data/Guardfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# A guardfile for making Danger Plugins
|
|
2
|
+
# For more info see https://github.com/guard/guard#readme
|
|
3
|
+
|
|
4
|
+
# To run, use `bundle exec guard`.
|
|
5
|
+
|
|
6
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
|
7
|
+
require 'guard/rspec/dsl'
|
|
8
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
|
9
|
+
|
|
10
|
+
# RSpec files
|
|
11
|
+
rspec = dsl.rspec
|
|
12
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
|
13
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
|
14
|
+
watch(rspec.spec_files)
|
|
15
|
+
|
|
16
|
+
# Ruby files
|
|
17
|
+
ruby = dsl.ruby
|
|
18
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
|
19
|
+
end
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2018 HootSuite Media Inc.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# danger-xccov_summary
|
|
2
|
+
|
|
3
|
+
A description of danger-xccov_summary.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
$ gem install danger-xccov_summary
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
Simply add `xccov_summary` to your `Dangerfile`.
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
xccov_summary.configure('path/to/buildDirectory')
|
|
15
|
+
xccov_summary.show_coverage
|
|
16
|
+
```
|
|
17
|
+
And it will look like:
|
|
18
|
+
|
|
19
|
+
To make sure the PR has a minimum amount of coverage call the method. Passing `fail` for `notify_level` will fail the build if coverage doesn't meet the minimum:
|
|
20
|
+
```ruby
|
|
21
|
+
xccov_summary.notify_if_coverage_is_less_than(minimum_coverage: 100.00, options: {:notify_level=>:warn})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Development
|
|
25
|
+
|
|
26
|
+
1. Clone this repo
|
|
27
|
+
2. Run `bundle install` to setup dependencies.
|
|
28
|
+
3. Run `bundle exec rake spec` to run the tests.
|
|
29
|
+
4. Use `bundle exec guard` to automatically have tests run as you make changes.
|
|
30
|
+
5. Make your changes.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'bundler/gem_tasks'
|
|
2
|
+
require 'rspec/core/rake_task'
|
|
3
|
+
require 'rubocop/rake_task'
|
|
4
|
+
|
|
5
|
+
RSpec::Core::RakeTask.new(:specs)
|
|
6
|
+
|
|
7
|
+
task default: :specs
|
|
8
|
+
|
|
9
|
+
task :spec do
|
|
10
|
+
Rake::Task['specs'].invoke
|
|
11
|
+
Rake::Task['rubocop'].invoke
|
|
12
|
+
Rake::Task['spec_docs'].invoke
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
desc 'Run RuboCop on the lib/specs directory'
|
|
16
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
17
|
+
task.patterns = ['lib/**/*.rb', 'spec/**/*.rb']
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
desc 'Ensure that the plugin passes `danger plugins lint`'
|
|
21
|
+
task :spec_docs do
|
|
22
|
+
sh 'bundle exec danger plugins lint'
|
|
23
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require 'xccov_summary/gem_version.rb'
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = 'danger-xccov_summary'
|
|
8
|
+
spec.version = XccovSummary::VERSION
|
|
9
|
+
spec.authors = ['Taylor Ledingham']
|
|
10
|
+
spec.email = ['taylor.ledingham@hootsuite.com']
|
|
11
|
+
spec.description = ''
|
|
12
|
+
spec.summary = ''
|
|
13
|
+
spec.homepage = 'https://github.hootops.com/taylorledingham/xccov-summary'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
|
|
16
|
+
spec.files = `git ls-files`.split($/)
|
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
|
+
spec.require_paths = ['lib']
|
|
20
|
+
|
|
21
|
+
spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
|
|
22
|
+
|
|
23
|
+
# General ruby development
|
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
|
25
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
|
26
|
+
|
|
27
|
+
# Testing support
|
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
|
29
|
+
|
|
30
|
+
# Linting code and docs
|
|
31
|
+
spec.add_development_dependency 'rubocop'
|
|
32
|
+
spec.add_development_dependency 'yard'
|
|
33
|
+
|
|
34
|
+
# Makes testing easy via `bundle exec guard`
|
|
35
|
+
spec.add_development_dependency 'guard', '~> 2.14'
|
|
36
|
+
spec.add_development_dependency 'guard-rspec', '~> 4.7'
|
|
37
|
+
|
|
38
|
+
# If you want to work on older builds of ruby
|
|
39
|
+
spec.add_development_dependency 'listen', '3.0.7'
|
|
40
|
+
|
|
41
|
+
# This gives you the chance to run a REPL inside your tests
|
|
42
|
+
# via:
|
|
43
|
+
#
|
|
44
|
+
# require 'pry'
|
|
45
|
+
# binding.pry
|
|
46
|
+
#
|
|
47
|
+
# This will stop test execution and let you inspect the results
|
|
48
|
+
spec.add_development_dependency 'pry'
|
|
49
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'xccov_summary/plugin'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require "xccov_summary/gem_version"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
module Danger
|
|
2
|
+
# This plugin will show the coverage of the project. You can add warnings or failures
|
|
3
|
+
# depending on the coverage percentage. It uses Xcode xccov to generate the coverage report.
|
|
4
|
+
#
|
|
5
|
+
# @example Require a minimum file coverage of 30%, a project coverage of 60% and show all modified files coverage
|
|
6
|
+
# xccov_summary.configure("Path/to/my/build_directory")
|
|
7
|
+
# xccov_summary.notify_if_coverage_is_less_than(minimum_coverage: 60)
|
|
8
|
+
# xccov_summary.show_coverage
|
|
9
|
+
# @see /danger-xccov_summary
|
|
10
|
+
# @tags codecoverage
|
|
11
|
+
|
|
12
|
+
class DangerXccovSummary < Plugin
|
|
13
|
+
|
|
14
|
+
# Required method to configure xccov. It's required to provide the path to the build directory.
|
|
15
|
+
# @param [String] build_directory path where the derivied data folder lives
|
|
16
|
+
# @return [void]
|
|
17
|
+
def configure(project_build_directory)
|
|
18
|
+
@build_directory = project_build_directory
|
|
19
|
+
calculate_total_coverage
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Method to check if the coverage of the project is at least a minumum
|
|
24
|
+
# @param options [Hash] a hash with the options
|
|
25
|
+
# @option options [Float] :minimum_coverage the minimum code coverage required
|
|
26
|
+
# @option options [Symbol] :notify_level the level of notification
|
|
27
|
+
# @return [Array<String>]
|
|
28
|
+
def notify_if_coverage_is_less_than(options)
|
|
29
|
+
minimum_coverage = options[:minimum_coverage]
|
|
30
|
+
notify_level = options[:notify_level] || :fail
|
|
31
|
+
current_coverage = @current_coverage
|
|
32
|
+
if current_coverage < minimum_coverage
|
|
33
|
+
notify_message = "Total coverage is #{current_coverage} and is less than minimum: #{minimum_coverage}%"
|
|
34
|
+
if notify_level == :fail
|
|
35
|
+
fail notify_message
|
|
36
|
+
else
|
|
37
|
+
warn notify_message
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Show a header with the total coverage and coverage table
|
|
43
|
+
# @return [Array<String>]
|
|
44
|
+
def show_coverage
|
|
45
|
+
line = "## Code coverage\n"
|
|
46
|
+
line << total_coverage_markdown
|
|
47
|
+
markdown line
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
# String header with the total coverage of the project
|
|
53
|
+
# @return [String]
|
|
54
|
+
def total_coverage_markdown
|
|
55
|
+
"### Total coverage: **`#{@current_coverage}%`**\n"
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Total coverage of the project
|
|
59
|
+
|
|
60
|
+
def calculate_total_coverage
|
|
61
|
+
result = `xcrun xccov view #{@build_directory}/Logs/Test/*.xccovreport --json`
|
|
62
|
+
coverage_report = JSON.parse(result)
|
|
63
|
+
@current_coverage = (coverage_report['lineCoverage'] * 100).round(2)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end
|
|
67
|
+
end
|
|
Binary file
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require "pathname"
|
|
2
|
+
ROOT = Pathname.new(File.expand_path("../../", __FILE__))
|
|
3
|
+
$:.unshift((ROOT + "lib").to_s)
|
|
4
|
+
$:.unshift((ROOT + "spec").to_s)
|
|
5
|
+
|
|
6
|
+
require "bundler/setup"
|
|
7
|
+
require "pry"
|
|
8
|
+
|
|
9
|
+
require "rspec"
|
|
10
|
+
require "danger"
|
|
11
|
+
|
|
12
|
+
if `git remote -v` == ''
|
|
13
|
+
puts "You cannot run tests without setting a local git remote on this repo"
|
|
14
|
+
puts "It's a weird side-effect of Danger's internals."
|
|
15
|
+
exit(0)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Use coloured output, it's the best.
|
|
19
|
+
RSpec.configure do |config|
|
|
20
|
+
config.filter_gems_from_backtrace "bundler"
|
|
21
|
+
config.color = true
|
|
22
|
+
config.tty = true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
require "danger_plugin"
|
|
26
|
+
|
|
27
|
+
# These functions are a subset of https://github.com/danger/danger/blob/master/spec/spec_helper.rb
|
|
28
|
+
# If you are expanding these files, see if it's already been done ^.
|
|
29
|
+
|
|
30
|
+
# A silent version of the user interface,
|
|
31
|
+
# it comes with an extra function `.string` which will
|
|
32
|
+
# strip all ANSI colours from the string.
|
|
33
|
+
|
|
34
|
+
# rubocop:disable Lint/NestedMethodDefinition
|
|
35
|
+
def testing_ui
|
|
36
|
+
@output = StringIO.new
|
|
37
|
+
def @output.winsize
|
|
38
|
+
[20, 9999]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
cork = Cork::Board.new(out: @output)
|
|
42
|
+
def cork.string
|
|
43
|
+
out.string.gsub(/\e\[([;\d]+)?m/, "")
|
|
44
|
+
end
|
|
45
|
+
cork
|
|
46
|
+
end
|
|
47
|
+
# rubocop:enable Lint/NestedMethodDefinition
|
|
48
|
+
|
|
49
|
+
# Example environment (ENV) that would come from
|
|
50
|
+
# running a PR on TravisCI
|
|
51
|
+
def testing_env
|
|
52
|
+
{
|
|
53
|
+
"HAS_JOSH_K_SEAL_OF_APPROVAL" => "true",
|
|
54
|
+
"TRAVIS_PULL_REQUEST" => "800",
|
|
55
|
+
"TRAVIS_REPO_SLUG" => "artsy/eigen",
|
|
56
|
+
"TRAVIS_COMMIT_RANGE" => "759adcbd0d8f...13c4dc8bb61d",
|
|
57
|
+
"DANGER_GITHUB_API_TOKEN" => "123sbdq54erfsd3422gdfio"
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# A stubbed out Dangerfile for use in tests
|
|
62
|
+
def testing_dangerfile
|
|
63
|
+
env = Danger::EnvironmentManager.new(testing_env)
|
|
64
|
+
Danger::Dangerfile.new(env, testing_ui)
|
|
65
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
require File.expand_path("../spec_helper", __FILE__)
|
|
2
|
+
|
|
3
|
+
module Danger
|
|
4
|
+
describe Danger::DangerXccovSummary do
|
|
5
|
+
it "should be a plugin" do
|
|
6
|
+
expect(Danger::DangerXccovSummary.new(nil)).to be_a Danger::Plugin
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
#
|
|
10
|
+
# You should test your custom attributes and methods here
|
|
11
|
+
#
|
|
12
|
+
describe "with Dangerfile" do
|
|
13
|
+
before do
|
|
14
|
+
@dangerfile = testing_dangerfile
|
|
15
|
+
@my_plugin = @dangerfile.xccov_summary
|
|
16
|
+
@my_plugin.total_coverage_markdown("70.99")
|
|
17
|
+
|
|
18
|
+
# mock the PR data
|
|
19
|
+
# you can then use this, eg. github.pr_author, later in the spec
|
|
20
|
+
json = File.read(File.dirname(__FILE__) + '/support/fixtures/github_pr.json') # example json: `curl https://api.github.com/repos/danger/danger-plugin-template/pulls/18 > github_pr.json`
|
|
21
|
+
allow(@my_plugin.github).to receive(:pr_json).and_return(json)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: danger-xccov_summary
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.7
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Taylor Ledingham
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-06-29 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: danger-plugin-api
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.0'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: bundler
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.3'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.3'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rake
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '10.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '10.0'
|
|
55
|
+
- !ruby/object:Gem::Dependency
|
|
56
|
+
name: rspec
|
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
|
58
|
+
requirements:
|
|
59
|
+
- - "~>"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '3.4'
|
|
62
|
+
type: :development
|
|
63
|
+
prerelease: false
|
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
+
requirements:
|
|
66
|
+
- - "~>"
|
|
67
|
+
- !ruby/object:Gem::Version
|
|
68
|
+
version: '3.4'
|
|
69
|
+
- !ruby/object:Gem::Dependency
|
|
70
|
+
name: rubocop
|
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
|
72
|
+
requirements:
|
|
73
|
+
- - ">="
|
|
74
|
+
- !ruby/object:Gem::Version
|
|
75
|
+
version: '0'
|
|
76
|
+
type: :development
|
|
77
|
+
prerelease: false
|
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
+
requirements:
|
|
80
|
+
- - ">="
|
|
81
|
+
- !ruby/object:Gem::Version
|
|
82
|
+
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: yard
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :development
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: guard
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - "~>"
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '2.14'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - "~>"
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '2.14'
|
|
111
|
+
- !ruby/object:Gem::Dependency
|
|
112
|
+
name: guard-rspec
|
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
|
114
|
+
requirements:
|
|
115
|
+
- - "~>"
|
|
116
|
+
- !ruby/object:Gem::Version
|
|
117
|
+
version: '4.7'
|
|
118
|
+
type: :development
|
|
119
|
+
prerelease: false
|
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
121
|
+
requirements:
|
|
122
|
+
- - "~>"
|
|
123
|
+
- !ruby/object:Gem::Version
|
|
124
|
+
version: '4.7'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: listen
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - '='
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: 3.0.7
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - '='
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: 3.0.7
|
|
139
|
+
- !ruby/object:Gem::Dependency
|
|
140
|
+
name: pry
|
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
|
142
|
+
requirements:
|
|
143
|
+
- - ">="
|
|
144
|
+
- !ruby/object:Gem::Version
|
|
145
|
+
version: '0'
|
|
146
|
+
type: :development
|
|
147
|
+
prerelease: false
|
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
149
|
+
requirements:
|
|
150
|
+
- - ">="
|
|
151
|
+
- !ruby/object:Gem::Version
|
|
152
|
+
version: '0'
|
|
153
|
+
description: ''
|
|
154
|
+
email:
|
|
155
|
+
- taylor.ledingham@hootsuite.com
|
|
156
|
+
executables: []
|
|
157
|
+
extensions: []
|
|
158
|
+
extra_rdoc_files: []
|
|
159
|
+
files:
|
|
160
|
+
- ".rubocop.yml"
|
|
161
|
+
- ".yardoc/checksums"
|
|
162
|
+
- ".yardoc/complete"
|
|
163
|
+
- ".yardoc/object_types"
|
|
164
|
+
- ".yardoc/objects/root.dat"
|
|
165
|
+
- ".yardoc/proxy_types"
|
|
166
|
+
- Gemfile
|
|
167
|
+
- Gemfile.lock
|
|
168
|
+
- Guardfile
|
|
169
|
+
- LICENSE.txt
|
|
170
|
+
- README.md
|
|
171
|
+
- Rakefile
|
|
172
|
+
- danger-xccov_summary.gemspec
|
|
173
|
+
- lib/danger_plugin.rb
|
|
174
|
+
- lib/danger_xccov_summary.rb
|
|
175
|
+
- lib/xccov_summary/gem_version.rb
|
|
176
|
+
- lib/xccov_summary/plugin.rb
|
|
177
|
+
- pkg/danger-xccov_summary-0.0.1.gem
|
|
178
|
+
- spec/spec_helper.rb
|
|
179
|
+
- spec/xccov_summary_spec.rb
|
|
180
|
+
homepage: https://github.hootops.com/taylorledingham/xccov-summary
|
|
181
|
+
licenses:
|
|
182
|
+
- MIT
|
|
183
|
+
metadata: {}
|
|
184
|
+
post_install_message:
|
|
185
|
+
rdoc_options: []
|
|
186
|
+
require_paths:
|
|
187
|
+
- lib
|
|
188
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
189
|
+
requirements:
|
|
190
|
+
- - ">="
|
|
191
|
+
- !ruby/object:Gem::Version
|
|
192
|
+
version: '0'
|
|
193
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
|
+
requirements:
|
|
195
|
+
- - ">="
|
|
196
|
+
- !ruby/object:Gem::Version
|
|
197
|
+
version: '0'
|
|
198
|
+
requirements: []
|
|
199
|
+
rubyforge_project:
|
|
200
|
+
rubygems_version: 2.7.3
|
|
201
|
+
signing_key:
|
|
202
|
+
specification_version: 4
|
|
203
|
+
summary: ''
|
|
204
|
+
test_files:
|
|
205
|
+
- spec/spec_helper.rb
|
|
206
|
+
- spec/xccov_summary_spec.rb
|