simplecov 0.7.1 → 0.8.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -2
- data/CHANGELOG.md +17 -2
- data/Gemfile +13 -2
- data/{LICENSE → MIT-LICENSE} +0 -0
- data/README.md +174 -117
- data/Rakefile +8 -3
- data/features/config_command_name.feature +12 -0
- data/features/config_merge_timeout.feature +3 -3
- data/features/config_profiles.feature +44 -0
- data/features/config_project_name.feature +2 -2
- data/features/cucumber_basic.feature +1 -1
- data/features/step_definitions/html_steps.rb +1 -1
- data/features/support/env.rb +23 -5
- data/gemfiles/multi_json_legacy.gemfile +12 -0
- data/gemfiles/multi_json_new.gemfile +12 -0
- data/lib/simplecov.rb +33 -25
- data/lib/simplecov/command_guesser.rb +6 -6
- data/lib/simplecov/configuration.rb +7 -2
- data/lib/simplecov/defaults.rb +9 -5
- data/lib/simplecov/file_list.rb +1 -1
- data/lib/simplecov/jruby16_fix.rb +43 -0
- data/lib/simplecov/no_defaults.rb +2 -0
- data/lib/simplecov/{adapters.rb → profiles.rb} +8 -8
- data/lib/simplecov/result.rb +10 -2
- data/lib/simplecov/source_file.rb +2 -3
- data/lib/simplecov/version.rb +1 -1
- data/simplecov.gemspec +8 -9
- data/test/faked_project/Gemfile +1 -1
- data/test/helper.rb +0 -1
- data/test/shoulda_macros.rb +0 -10
- data/test/test_1_8_fallbacks.rb +16 -18
- data/test/test_command_guesser.rb +13 -15
- data/test/test_deleted_source.rb +5 -7
- data/test/test_file_list.rb +15 -17
- data/test/test_filters.rb +56 -58
- data/test/test_merge_helpers.rb +73 -75
- data/test/test_result.rb +114 -116
- data/test/test_return_codes.rb +24 -26
- data/test/test_source_file.rb +75 -64
- data/test/test_source_file_line.rb +78 -82
- metadata +38 -86
- data/features/config_adapters.feature +0 -44
- data/gemfiles/multi_json-legacy.gemfile +0 -7
- data/gemfiles/multi_json-new.gemfile +0 -7
@@ -1,110 +1,106 @@
|
|
1
1
|
require 'helper'
|
2
2
|
|
3
3
|
class TestSourceFileLine < Test::Unit::TestCase
|
4
|
+
context "A source line" do
|
5
|
+
setup do
|
6
|
+
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
|
7
|
+
end
|
8
|
+
subject { @line }
|
4
9
|
|
10
|
+
should 'return "# the ruby source" as src' do
|
11
|
+
assert_equal '# the ruby source', @line.src
|
12
|
+
end
|
5
13
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
|
10
|
-
end
|
11
|
-
subject { @line }
|
12
|
-
|
13
|
-
should 'return "# the ruby source" as src' do
|
14
|
-
assert_equal '# the ruby source', @line.src
|
15
|
-
end
|
16
|
-
|
17
|
-
should 'return the same for source as for src' do
|
18
|
-
assert_equal @line.src, @line.source
|
19
|
-
end
|
20
|
-
|
21
|
-
should 'have line number 5' do
|
22
|
-
assert_equal 5, @line.line_number
|
23
|
-
end
|
24
|
-
|
25
|
-
should 'have equal line_number, line and number' do
|
26
|
-
assert_equal @line.line_number, @line.line
|
27
|
-
assert_equal @line.line_number, @line.number
|
28
|
-
end
|
29
|
-
|
30
|
-
context "flagged as skipped!" do
|
31
|
-
setup { @line.skipped! }
|
14
|
+
should 'return the same for source as for src' do
|
15
|
+
assert_equal @line.src, @line.source
|
16
|
+
end
|
32
17
|
|
33
|
-
|
34
|
-
|
35
|
-
should_not_be :missed?
|
36
|
-
should_not_be :never?
|
37
|
-
should_have :status, 'skipped'
|
38
|
-
end
|
18
|
+
should 'have line number 5' do
|
19
|
+
assert_equal 5, @line.line_number
|
39
20
|
end
|
40
21
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
subject { @line }
|
22
|
+
should 'have equal line_number, line and number' do
|
23
|
+
assert_equal @line.line_number, @line.line
|
24
|
+
assert_equal @line.line_number, @line.number
|
25
|
+
end
|
46
26
|
|
47
|
-
|
48
|
-
|
49
|
-
end
|
27
|
+
context "flagged as skipped!" do
|
28
|
+
setup { @line.skipped! }
|
50
29
|
|
51
|
-
|
52
|
-
|
30
|
+
should_not_be :covered?
|
31
|
+
should_be :skipped?
|
53
32
|
should_not_be :missed?
|
54
33
|
should_not_be :never?
|
55
|
-
should_have :status, '
|
34
|
+
should_have :status, 'skipped'
|
56
35
|
end
|
36
|
+
end
|
57
37
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
38
|
+
context "A source line with coverage" do
|
39
|
+
setup do
|
40
|
+
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 3)
|
41
|
+
end
|
42
|
+
subject { @line }
|
63
43
|
|
64
|
-
|
65
|
-
|
66
|
-
|
44
|
+
should "have coverage of 3" do
|
45
|
+
assert_equal 3, @line.coverage
|
46
|
+
end
|
67
47
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
48
|
+
should_be :covered?
|
49
|
+
should_not_be :skipped?
|
50
|
+
should_not_be :missed?
|
51
|
+
should_not_be :never?
|
52
|
+
should_have :status, 'covered'
|
53
|
+
end
|
54
|
+
|
55
|
+
context "A source line without coverage" do
|
56
|
+
setup do
|
57
|
+
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, 0)
|
73
58
|
end
|
59
|
+
subject { @line }
|
74
60
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
end
|
79
|
-
subject { @line }
|
61
|
+
should "have coverage of 0" do
|
62
|
+
assert_equal 0, @line.coverage
|
63
|
+
end
|
80
64
|
|
81
|
-
|
82
|
-
|
83
|
-
|
65
|
+
should_not_be :covered?
|
66
|
+
should_not_be :skipped?
|
67
|
+
should_be :missed?
|
68
|
+
should_not_be :never?
|
69
|
+
should_have :status, 'missed'
|
70
|
+
end
|
84
71
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
should_be :never?
|
89
|
-
should_have :status, 'never'
|
72
|
+
context "A source line with no code" do
|
73
|
+
setup do
|
74
|
+
@line = SimpleCov::SourceFile::Line.new('# the ruby source', 5, nil)
|
90
75
|
end
|
76
|
+
subject { @line }
|
91
77
|
|
92
|
-
should "
|
93
|
-
|
94
|
-
SimpleCov::SourceFile::Line.new(:symbol, 5, 3)
|
95
|
-
end
|
78
|
+
should "have nil coverage" do
|
79
|
+
assert_nil @line.coverage
|
96
80
|
end
|
97
81
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
82
|
+
should_not_be :covered?
|
83
|
+
should_not_be :skipped?
|
84
|
+
should_not_be :missed?
|
85
|
+
should_be :never?
|
86
|
+
should_have :status, 'never'
|
87
|
+
end
|
88
|
+
|
89
|
+
should "raise ArgumentError when initialized with invalid src" do
|
90
|
+
assert_raise ArgumentError do
|
91
|
+
SimpleCov::SourceFile::Line.new(:symbol, 5, 3)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
should "raise ArgumentError when initialized with invalid line_number" do
|
96
|
+
assert_raise ArgumentError do
|
97
|
+
SimpleCov::SourceFile::Line.new("some source", "five", 3)
|
102
98
|
end
|
99
|
+
end
|
103
100
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
end
|
101
|
+
should "raise ArgumentError when initialized with invalid coverage" do
|
102
|
+
assert_raise ArgumentError do
|
103
|
+
SimpleCov::SourceFile::Line.new("some source", 5, "three")
|
108
104
|
end
|
109
105
|
end
|
110
|
-
end
|
106
|
+
end if SimpleCov.usable?
|
metadata
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simplecov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.8.0.pre
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Christoph Olszowka
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-04-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ! '>='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '0'
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: simplecov-html
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -43,119 +43,71 @@ dependencies:
|
|
43
43
|
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 0.7.1
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: aruba
|
48
|
-
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
|
-
requirements:
|
51
|
-
- - ! '>='
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '0'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
|
-
requirements:
|
59
|
-
- - ! '>='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: capybara
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0'
|
78
46
|
- !ruby/object:Gem::Dependency
|
79
47
|
name: appraisal
|
80
48
|
requirement: !ruby/object:Gem::Requirement
|
81
49
|
none: false
|
82
50
|
requirements:
|
83
|
-
- -
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
version: '0'
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
|
-
requirements:
|
91
|
-
- - ! '>='
|
92
|
-
- !ruby/object:Gem::Version
|
93
|
-
version: '0'
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: cucumber
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
51
|
+
- - ~>
|
100
52
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
53
|
+
version: 0.5.1
|
102
54
|
type: :development
|
103
55
|
prerelease: false
|
104
56
|
version_requirements: !ruby/object:Gem::Requirement
|
105
57
|
none: false
|
106
58
|
requirements:
|
107
|
-
- -
|
59
|
+
- - ~>
|
108
60
|
- !ruby/object:Gem::Version
|
109
|
-
version:
|
61
|
+
version: 0.5.1
|
110
62
|
- !ruby/object:Gem::Dependency
|
111
63
|
name: rake
|
112
64
|
requirement: !ruby/object:Gem::Requirement
|
113
65
|
none: false
|
114
66
|
requirements:
|
115
|
-
- -
|
67
|
+
- - ~>
|
116
68
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
69
|
+
version: 10.0.3
|
118
70
|
type: :development
|
119
71
|
prerelease: false
|
120
72
|
version_requirements: !ruby/object:Gem::Requirement
|
121
73
|
none: false
|
122
74
|
requirements:
|
123
|
-
- -
|
75
|
+
- - ~>
|
124
76
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
77
|
+
version: 10.0.3
|
126
78
|
- !ruby/object:Gem::Dependency
|
127
79
|
name: rspec
|
128
80
|
requirement: !ruby/object:Gem::Requirement
|
129
81
|
none: false
|
130
82
|
requirements:
|
131
|
-
- -
|
83
|
+
- - ~>
|
132
84
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
85
|
+
version: 2.13.0
|
134
86
|
type: :development
|
135
87
|
prerelease: false
|
136
88
|
version_requirements: !ruby/object:Gem::Requirement
|
137
89
|
none: false
|
138
90
|
requirements:
|
139
|
-
- -
|
91
|
+
- - ~>
|
140
92
|
- !ruby/object:Gem::Version
|
141
|
-
version:
|
93
|
+
version: 2.13.0
|
142
94
|
- !ruby/object:Gem::Dependency
|
143
95
|
name: shoulda
|
144
96
|
requirement: !ruby/object:Gem::Requirement
|
145
97
|
none: false
|
146
98
|
requirements:
|
147
|
-
- -
|
99
|
+
- - ~>
|
148
100
|
- !ruby/object:Gem::Version
|
149
|
-
version:
|
101
|
+
version: 3.4.0
|
150
102
|
type: :development
|
151
103
|
prerelease: false
|
152
104
|
version_requirements: !ruby/object:Gem::Requirement
|
153
105
|
none: false
|
154
106
|
requirements:
|
155
|
-
- -
|
107
|
+
- - ~>
|
156
108
|
- !ruby/object:Gem::Version
|
157
|
-
version:
|
158
|
-
description: Code coverage for Ruby 1.9 with a powerful configuration library and
|
109
|
+
version: 3.4.0
|
110
|
+
description: Code coverage for Ruby 1.9+ with a powerful configuration library and
|
159
111
|
automatic merging of coverage across test suites
|
160
112
|
email:
|
161
113
|
- christoph at olszowka de
|
@@ -170,11 +122,10 @@ files:
|
|
170
122
|
- CHANGELOG.md
|
171
123
|
- CONTRIBUTING.md
|
172
124
|
- Gemfile
|
173
|
-
- LICENSE
|
125
|
+
- MIT-LICENSE
|
174
126
|
- README.md
|
175
127
|
- Rakefile
|
176
128
|
- cucumber.yml
|
177
|
-
- features/config_adapters.feature
|
178
129
|
- features/config_autoload.feature
|
179
130
|
- features/config_command_name.feature
|
180
131
|
- features/config_coverage_dir.feature
|
@@ -182,6 +133,7 @@ files:
|
|
182
133
|
- features/config_formatters.feature
|
183
134
|
- features/config_merge_timeout.feature
|
184
135
|
- features/config_nocov_token.feature
|
136
|
+
- features/config_profiles.feature
|
185
137
|
- features/config_project_name.feature
|
186
138
|
- features/config_styles.feature
|
187
139
|
- features/cucumber_basic.feature
|
@@ -207,10 +159,9 @@ files:
|
|
207
159
|
- features/test_unit_groups_using_filter_class.feature
|
208
160
|
- features/test_unit_without_simplecov.feature
|
209
161
|
- features/unicode_compatiblity.feature
|
210
|
-
- gemfiles/
|
211
|
-
- gemfiles/
|
162
|
+
- gemfiles/multi_json_legacy.gemfile
|
163
|
+
- gemfiles/multi_json_new.gemfile
|
212
164
|
- lib/simplecov.rb
|
213
|
-
- lib/simplecov/adapters.rb
|
214
165
|
- lib/simplecov/command_guesser.rb
|
215
166
|
- lib/simplecov/configuration.rb
|
216
167
|
- lib/simplecov/defaults.rb
|
@@ -220,9 +171,12 @@ files:
|
|
220
171
|
- lib/simplecov/formatter.rb
|
221
172
|
- lib/simplecov/formatter/multi_formatter.rb
|
222
173
|
- lib/simplecov/formatter/simple_formatter.rb
|
174
|
+
- lib/simplecov/jruby16_fix.rb
|
223
175
|
- lib/simplecov/json.rb
|
224
176
|
- lib/simplecov/last_run.rb
|
225
177
|
- lib/simplecov/merge_helpers.rb
|
178
|
+
- lib/simplecov/no_defaults.rb
|
179
|
+
- lib/simplecov/profiles.rb
|
226
180
|
- lib/simplecov/railtie.rb
|
227
181
|
- lib/simplecov/railties/tasks.rake
|
228
182
|
- lib/simplecov/result.rb
|
@@ -273,7 +227,8 @@ files:
|
|
273
227
|
- test/test_source_file.rb
|
274
228
|
- test/test_source_file_line.rb
|
275
229
|
homepage: http://github.com/colszowka/simplecov
|
276
|
-
licenses:
|
230
|
+
licenses:
|
231
|
+
- MIT
|
277
232
|
post_install_message:
|
278
233
|
rdoc_options: []
|
279
234
|
require_paths:
|
@@ -286,21 +241,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
286
241
|
version: '0'
|
287
242
|
segments:
|
288
243
|
- 0
|
289
|
-
hash: -
|
244
|
+
hash: -263830053031088353
|
290
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
291
246
|
none: false
|
292
247
|
requirements:
|
293
|
-
- - ! '
|
248
|
+
- - ! '>'
|
294
249
|
- !ruby/object:Gem::Version
|
295
|
-
version:
|
296
|
-
segments:
|
297
|
-
- 0
|
298
|
-
hash: -2884824259526901790
|
250
|
+
version: 1.3.1
|
299
251
|
requirements: []
|
300
252
|
rubyforge_project:
|
301
|
-
rubygems_version: 1.8.
|
253
|
+
rubygems_version: 1.8.25
|
302
254
|
signing_key:
|
303
255
|
specification_version: 3
|
304
|
-
summary: Code coverage for Ruby 1.9 with a powerful configuration library and automatic
|
256
|
+
summary: Code coverage for Ruby 1.9+ with a powerful configuration library and automatic
|
305
257
|
merging of coverage across test suites
|
306
258
|
test_files: []
|
@@ -1,44 +0,0 @@
|
|
1
|
-
@test_unit @config @adapters
|
2
|
-
Feature:
|
3
|
-
|
4
|
-
In order to re-use SimpleCov settings across projects,
|
5
|
-
adapters can be defined that hold configuration settings
|
6
|
-
that can be loaded at once.
|
7
|
-
|
8
|
-
Background:
|
9
|
-
Given SimpleCov for Test/Unit is configured with:
|
10
|
-
"""
|
11
|
-
require 'simplecov'
|
12
|
-
"""
|
13
|
-
|
14
|
-
Scenario: Defining and using a custom adapter
|
15
|
-
Given a file named ".simplecov" with:
|
16
|
-
"""
|
17
|
-
SimpleCov.adapters.define 'custom_command' do
|
18
|
-
command_name "Adapter Command"
|
19
|
-
end
|
20
|
-
|
21
|
-
SimpleCov.start do
|
22
|
-
load_adapter 'test_frameworks'
|
23
|
-
load_adapter 'custom_command'
|
24
|
-
end
|
25
|
-
"""
|
26
|
-
|
27
|
-
When I open the coverage report generated with `bundle exec rake test`
|
28
|
-
Then I should see "4 files in total."
|
29
|
-
And I should see "using Adapter Command" within "#footer"
|
30
|
-
|
31
|
-
Scenario: Using existing adapter in custom adapter and supplying adapter to start command
|
32
|
-
Given a file named ".simplecov" with:
|
33
|
-
"""
|
34
|
-
SimpleCov.adapters.define 'my_adapter' do
|
35
|
-
load_adapter 'test_frameworks'
|
36
|
-
command_name "My Adapter"
|
37
|
-
end
|
38
|
-
|
39
|
-
SimpleCov.start 'my_adapter'
|
40
|
-
"""
|
41
|
-
|
42
|
-
When I open the coverage report generated with `bundle exec rake test`
|
43
|
-
Then I should see "4 files in total."
|
44
|
-
And I should see "using My Adapter" within "#footer"
|