File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 4
4
module CC
5
5
module Engine
6
6
class BundlerAudit
7
+ GemfileLockNotFound = Class . new ( StandardError )
8
+
7
9
def initialize ( directory : , io : , engine_config : )
8
10
@directory = directory
9
11
@engine_config = engine_config
@@ -25,11 +27,7 @@ def run
25
27
@io . print ( "#{ issue . to_json } \0 " )
26
28
end
27
29
else
28
- warning = {
29
- type : "warning" ,
30
- description : "No Gemfile.lock file found"
31
- }
32
- @io . print ( "#{ warning . to_json } \0 " )
30
+ raise GemfileLockNotFound , "No Gemfile.lock found."
33
31
end
34
32
end
35
33
Original file line number Diff line number Diff line change 3
3
module CC ::Engine
4
4
describe BundlerAudit do
5
5
describe "#run" do
6
- it "emits a warning when no Gemfile exists" do
6
+ it "raises an error when no Gemfile.lock exists" do
7
7
FakeFS do
8
8
directory = "/c"
9
9
FileUtils . mkdir_p ( directory )
10
10
io = StringIO . new
11
11
config = { }
12
12
13
- BundlerAudit . new ( directory : directory , io : io , engine_config : config ) . run
14
-
15
- expect ( io . string ) . to match ( %{{"type":"warning","description":"No Gemfile.lock file found"}} )
13
+ expect { BundlerAudit . new ( directory : directory , io : io , engine_config : config ) . run }
14
+ . to raise_error ( CC ::Engine ::BundlerAudit ::GemfileLockNotFound )
16
15
end
17
16
end
18
17
You can’t perform that action at this time.
0 commit comments