|
83 | 83 | it 'registers an offense' do
|
84 | 84 | expect_offense(<<~'RUBY')
|
85 | 85 | "#{Rails.root}/app/models/goober"
|
86 |
| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path/to').to_s`. |
| 86 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path/to')`. |
87 | 87 | RUBY
|
88 | 88 | end
|
89 | 89 | end
|
|
92 | 92 | it 'registers an offense' do
|
93 | 93 | expect_offense(<<~'RUBY')
|
94 | 94 | system "rm -rf #{Rails.root}/foo/bar"
|
95 |
| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path/to').to_s`. |
| 95 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path/to')`. |
96 | 96 | RUBY
|
97 | 97 | end
|
98 | 98 | end
|
|
101 | 101 | it 'registers an offense' do
|
102 | 102 | expect_offense(<<~'RUBY')
|
103 | 103 | "#{Rails.root.join('tmp', user.id, 'icon')}.png"
|
104 |
| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path/to').to_s`. |
| 104 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path/to')`. |
105 | 105 | RUBY
|
106 | 106 | end
|
107 | 107 | end
|
|
211 | 211 | it 'registers an offense' do
|
212 | 212 | expect_offense(<<~'RUBY')
|
213 | 213 | "#{Rails.root}/app/models/goober"
|
214 |
| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path', 'to').to_s`. |
| 214 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path', 'to')`. |
215 | 215 | RUBY
|
216 | 216 | end
|
217 | 217 | end
|
|
220 | 220 | it 'registers an offense' do
|
221 | 221 | expect_offense(<<~'RUBY')
|
222 | 222 | system "rm -rf #{Rails.root}/foo/bar"
|
223 |
| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path', 'to').to_s`. |
| 223 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path', 'to')`. |
224 | 224 | RUBY
|
225 | 225 | end
|
226 | 226 | end
|
|
229 | 229 | it 'registers an offense' do
|
230 | 230 | expect_offense(<<~'RUBY')
|
231 | 231 | "#{Rails.root.join('tmp', user.id, 'icon')}.png"
|
232 |
| - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path', 'to').to_s`. |
| 232 | + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `Rails.root.join('path', 'to')`. |
233 | 233 | RUBY
|
234 | 234 | end
|
235 | 235 | end
|
|
0 commit comments