File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ # typed: true
2+ # frozen_string_literal: true
3+
4+ require "test_helper"
5+
6+ module Packwerk
7+ class ReferencesFromFileTest < Minitest ::Test
8+
9+ setup do
10+ config = Configuration . new
11+ config . stubs ( :load_paths ) . returns ( { } )
12+ @run_context = RunContext . from_configuration ( config )
13+ RunContext . stubs ( :from_configuration ) . with ( config ) . returns ( @run_context )
14+ @referencer = ReferencesFromFile . new ( config )
15+ end
16+
17+ test "raises on parser error" do
18+ offense = Offense . new ( file : "something.rb" , message : "yo" )
19+ @run_context . stubs ( :references_from_file ) . returns (
20+ RunContext ::FileReferencesResult . new ( file_offenses : [ offense ] , references : [ ] )
21+ )
22+
23+ assert_raises ReferencesFromFile ::FileParserError do
24+ @referencer . list ( "lib/something.rb" )
25+ end
26+ end
27+ end
28+ end
29+
30+ # @referencer.stubs(files).returns(["lib/something.rb"])
You can’t perform that action at this time.
0 commit comments