3
3
4
4
require "test_helper"
5
5
6
- class GotoRelevantFileTest < Minitest ::Test
6
+ class GoToRelevantFileTest < Minitest ::Test
7
7
def test_when_input_is_test_file_returns_array_of_implementation_file_locations
8
- stub_glob_pattern ( "**/goto_relevant_file .rb" , [ "lib/ruby_lsp/requests/goto_relevant_file .rb" ] )
8
+ stub_glob_pattern ( "**/go_to_relevant_file .rb" , [ "lib/ruby_lsp/requests/go_to_relevant_file .rb" ] )
9
9
10
- test_file_path = "/workspace/test/requests/goto_relevant_file_test .rb"
11
- expected = [ "/workspace/lib/ruby_lsp/requests/goto_relevant_file .rb" ]
10
+ test_file_path = "/workspace/test/requests/go_to_relevant_file_test .rb"
11
+ expected = [ "/workspace/lib/ruby_lsp/requests/go_to_relevant_file .rb" ]
12
12
13
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_file_path , "/workspace" ) . perform
13
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_file_path , "/workspace" ) . perform
14
14
assert_equal ( expected , result )
15
15
end
16
16
17
17
def test_when_input_is_implementation_file_returns_array_of_test_file_locations
18
18
pattern =
19
- "**/{{test_,spec_,integration_test_}goto_relevant_file,goto_relevant_file {_test,_spec,_integration_test}}.rb"
20
- stub_glob_pattern ( pattern , [ "test/requests/goto_relevant_file_test .rb" ] )
19
+ "**/{{test_,spec_,integration_test_}go_to_relevant_file,go_to_relevant_file {_test,_spec,_integration_test}}.rb"
20
+ stub_glob_pattern ( pattern , [ "test/requests/go_to_relevant_file_test .rb" ] )
21
21
22
- impl_path = "/workspace/lib/ruby_lsp/requests/goto_relevant_file .rb"
23
- expected = [ "/workspace/test/requests/goto_relevant_file_test .rb" ]
22
+ impl_path = "/workspace/lib/ruby_lsp/requests/go_to_relevant_file .rb"
23
+ expected = [ "/workspace/test/requests/go_to_relevant_file_test .rb" ]
24
24
25
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( impl_path , "/workspace" ) . perform
25
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( impl_path , "/workspace" ) . perform
26
26
assert_equal ( expected , result )
27
27
end
28
28
@@ -40,7 +40,7 @@ def test_return_all_file_locations_that_have_the_same_highest_coefficient
40
40
"/workspace/test/integration/some_feature_test.rb" ,
41
41
]
42
42
43
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( impl_path , "/workspace" ) . perform
43
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( impl_path , "/workspace" ) . perform
44
44
assert_equal ( expected . sort , result . sort )
45
45
end
46
46
@@ -49,7 +49,7 @@ def test_return_empty_array_when_no_filename_matches
49
49
stub_glob_pattern ( pattern , [ ] )
50
50
51
51
file_path = "/workspace/lib/ruby_lsp/requests/nonexistent_file.rb"
52
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( file_path , "/workspace" ) . perform
52
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( file_path , "/workspace" ) . perform
53
53
assert_empty ( result )
54
54
end
55
55
@@ -59,7 +59,7 @@ def test_it_finds_implementation_when_file_has_test_suffix
59
59
test_path = "/workspace/test/feature_test.rb"
60
60
expected = [ "/workspace/lib/feature.rb" ]
61
61
62
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_path , "/workspace" ) . perform
62
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_path , "/workspace" ) . perform
63
63
assert_equal ( expected , result )
64
64
end
65
65
@@ -69,7 +69,7 @@ def test_it_finds_implementation_when_file_has_spec_suffix
69
69
test_path = "/workspace/spec/feature_spec.rb"
70
70
expected = [ "/workspace/lib/feature.rb" ]
71
71
72
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_path , "/workspace" ) . perform
72
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_path , "/workspace" ) . perform
73
73
assert_equal ( expected , result )
74
74
end
75
75
@@ -79,7 +79,7 @@ def test_it_finds_implementation_when_file_has_integration_test_suffix
79
79
test_path = "/workspace/test/feature_integration_test.rb"
80
80
expected = [ "/workspace/lib/feature.rb" ]
81
81
82
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_path , "/workspace" ) . perform
82
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_path , "/workspace" ) . perform
83
83
assert_equal ( expected , result )
84
84
end
85
85
@@ -89,7 +89,7 @@ def test_it_finds_implementation_when_file_has_test_prefix
89
89
test_path = "/workspace/test/test_feature.rb"
90
90
expected = [ "/workspace/lib/feature.rb" ]
91
91
92
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_path , "/workspace" ) . perform
92
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_path , "/workspace" ) . perform
93
93
assert_equal ( expected , result )
94
94
end
95
95
@@ -99,7 +99,7 @@ def test_it_finds_implementation_when_file_has_spec_prefix
99
99
test_path = "/workspace/test/spec_feature.rb"
100
100
expected = [ "/workspace/lib/feature.rb" ]
101
101
102
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_path , "/workspace" ) . perform
102
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_path , "/workspace" ) . perform
103
103
assert_equal ( expected , result )
104
104
end
105
105
@@ -109,7 +109,7 @@ def test_it_finds_implementation_when_file_has_integration_test_prefix
109
109
test_path = "/workspace/test/integration_test_feature.rb"
110
110
expected = [ "/workspace/lib/feature.rb" ]
111
111
112
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( test_path , "/workspace" ) . perform
112
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( test_path , "/workspace" ) . perform
113
113
assert_equal ( expected , result )
114
114
end
115
115
@@ -120,7 +120,7 @@ def test_it_finds_tests_for_implementation
120
120
impl_path = "/workspace/lib/feature.rb"
121
121
expected = [ "/workspace/test/feature_test.rb" ]
122
122
123
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( impl_path , "/workspace" ) . perform
123
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( impl_path , "/workspace" ) . perform
124
124
assert_equal ( expected , result )
125
125
end
126
126
@@ -131,7 +131,7 @@ def test_it_finds_specs_for_implementation
131
131
impl_path = "/workspace/lib/feature.rb"
132
132
expected = [ "/workspace/spec/feature_spec.rb" ]
133
133
134
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( impl_path , "/workspace" ) . perform
134
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( impl_path , "/workspace" ) . perform
135
135
assert_equal ( expected , result )
136
136
end
137
137
@@ -142,7 +142,7 @@ def test_it_finds_integration_tests_for_implementation
142
142
impl_path = "/workspace/lib/feature.rb"
143
143
expected = [ "/workspace/test/feature_integration_test.rb" ]
144
144
145
- result = RubyLsp ::Requests ::GotoRelevantFile . new ( impl_path , "/workspace" ) . perform
145
+ result = RubyLsp ::Requests ::GoToRelevantFile . new ( impl_path , "/workspace" ) . perform
146
146
assert_equal ( expected , result )
147
147
end
148
148
0 commit comments