letitcrash 0.1.1 → 0.1.2
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/lib/letitcrash/builders/file_builder.rb +1 -0
- data/lib/letitcrash/reporters/upload.rb +14 -0
- data/lib/letitcrash/version.rb +1 -1
- data/spec/builders/file_builder_spec.rb +33 -23
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65797c26e15f11f329c5053d132d6170caf78a4a
|
4
|
+
data.tar.gz: e0c656b78fce7ebf4671de2d43c5d50ace958363
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23c2b10ed26864ffc5726912c1ae2f7afd0e0a5a52f2e744cd5aa2181fc69b062266e96aee3d7e22af1280131266c5b49f0eed060073d6427a3d6b451bfc7904
|
7
|
+
data.tar.gz: 48f537b477fe4786a959d3ebf8ed3f4bb51328254c3003024031281840d44bba6d4a7481ab5244c4f6dbb7f2372421a9f0e5777e55b4e70acd033fe011e7d3e8
|
@@ -21,13 +21,27 @@ module LetItCrash
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def report(input)
|
24
|
+
blockers_off
|
24
25
|
RestClient.post(endpoint, input.to_json, headers)
|
26
|
+
blockers_on
|
25
27
|
end
|
26
28
|
|
27
29
|
private
|
28
30
|
|
29
31
|
attr_reader :endpoint, :token
|
30
32
|
|
33
|
+
# This method reeks of :reek:UtilityFunction.
|
34
|
+
def blockers_off
|
35
|
+
WebMock.disable! if defined?(WebMock)
|
36
|
+
VCR.turn_off!(ignore_cassettes: true) if defined?(VCR)
|
37
|
+
end
|
38
|
+
|
39
|
+
# This method reeks of :reek:UtilityFunction.
|
40
|
+
def blockers_on
|
41
|
+
WebMock.enable! if defined?(WebMock)
|
42
|
+
VCR.turn_on! if defined?(VCR)
|
43
|
+
end
|
44
|
+
|
31
45
|
def headers
|
32
46
|
{
|
33
47
|
content_type: :json,
|
data/lib/letitcrash/version.rb
CHANGED
@@ -7,30 +7,33 @@ module LetItCrash
|
|
7
7
|
RSpec.describe FileBuilder do
|
8
8
|
describe '.build' do
|
9
9
|
let(:filename) { 'spec/fixtures/source.file' }
|
10
|
+
let(:lines) do
|
11
|
+
[
|
12
|
+
instance_double(
|
13
|
+
SimpleCov::SourceFile::Line,
|
14
|
+
line_number: 1,
|
15
|
+
skipped?: false,
|
16
|
+
coverage: 0,
|
17
|
+
),
|
18
|
+
instance_double(
|
19
|
+
SimpleCov::SourceFile::Line,
|
20
|
+
line_number: 2,
|
21
|
+
skipped?: false,
|
22
|
+
coverage: 0,
|
23
|
+
),
|
24
|
+
instance_double(
|
25
|
+
SimpleCov::SourceFile::Line,
|
26
|
+
line_number: 3,
|
27
|
+
skipped?: false,
|
28
|
+
coverage: 1,
|
29
|
+
)
|
30
|
+
]
|
31
|
+
end
|
10
32
|
let(:file) do
|
11
33
|
instance_double(
|
12
34
|
SimpleCov::SourceFile,
|
13
35
|
filename: filename,
|
14
|
-
lines:
|
15
|
-
instance_double(
|
16
|
-
SimpleCov::SourceFile::Line,
|
17
|
-
line_number: 1,
|
18
|
-
skipped?: false,
|
19
|
-
coverage: 0,
|
20
|
-
),
|
21
|
-
instance_double(
|
22
|
-
SimpleCov::SourceFile::Line,
|
23
|
-
line_number: 2,
|
24
|
-
skipped?: false,
|
25
|
-
coverage: 0,
|
26
|
-
),
|
27
|
-
instance_double(
|
28
|
-
SimpleCov::SourceFile::Line,
|
29
|
-
line_number: 3,
|
30
|
-
skipped?: false,
|
31
|
-
coverage: 1,
|
32
|
-
)
|
33
|
-
],
|
36
|
+
lines: lines,
|
34
37
|
)
|
35
38
|
end
|
36
39
|
let(:result) { described_class.build(file: file, rewriter: rewriter) }
|
@@ -43,10 +46,10 @@ module LetItCrash
|
|
43
46
|
it { expect(result.digest).to start_with '73054' }
|
44
47
|
|
45
48
|
context 'with lines' do
|
46
|
-
let(:
|
49
|
+
let(:result_lines) { result.lines }
|
47
50
|
|
48
|
-
it { expect(
|
49
|
-
it { expect(
|
51
|
+
it { expect(result_lines.count).to eq 1 }
|
52
|
+
it { expect(result_lines[3]).to eq 1 }
|
50
53
|
end # context 'with lines'
|
51
54
|
|
52
55
|
context 'with path' do
|
@@ -62,6 +65,13 @@ module LetItCrash
|
|
62
65
|
|
63
66
|
it { expect(result.path.rewritten).to start_with 'bacon/spec' }
|
64
67
|
end # context 'with rewriter'
|
68
|
+
|
69
|
+
context 'with no relevant lines' do
|
70
|
+
let(:rewriter) { nil }
|
71
|
+
let(:lines) { [] }
|
72
|
+
|
73
|
+
it { expect(result.coverage).to eq 1 }
|
74
|
+
end # context 'with no relevant lines'
|
65
75
|
end # describe '.build'
|
66
76
|
end # RSpec.describe FileBuilder
|
67
77
|
end # module Builders
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: letitcrash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcin Wyszynski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-protobuf
|