File tree Expand file tree Collapse file tree 2 files changed +3
-28
lines changed Expand file tree Collapse file tree 2 files changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -196,13 +196,7 @@ def parse(
196
196
end
197
197
198
198
args . each do |file |
199
- begin
200
- require file
201
- rescue LoadError => e
202
- output . puts "Could not load file '#{ file } ': #{ e } "
203
- output . puts "Your file path should look like you're running a script, e.g. `./path/to/file.rb`" unless file . start_with? ( './' )
204
- return 1
205
- end
199
+ require File . expand_path ( file )
206
200
end
207
201
208
202
Que . logger ||= Logger . new ( STDOUT )
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ def write_file
121
121
it "should infer the default require file if it exists" do
122
122
filename = write_file
123
123
124
- assert_successful_invocation "" , default_require_file : "./ #{ filename } .rb"
124
+ assert_successful_invocation "" , default_require_file : "#{ filename } .rb"
125
125
126
126
assert_equal (
127
127
{ filename => true } ,
@@ -161,32 +161,13 @@ def write_file
161
161
162
162
it "should raise an error if any of the files don't exist" do
163
163
name = write_file
164
- code = execute "./#{ name } ./nonexistent_file"
165
- assert_equal 1 , code
166
-
167
- assert_equal [ "Could not load file './nonexistent_file': cannot load such file -- ./nonexistent_file" ] , output . messages
164
+ assert_raises ( LoadError ) { execute "#{ name } ./nonexistent_file" }
168
165
169
166
assert_equal (
170
167
{ name => true } ,
171
168
LOADED_FILES
172
169
)
173
170
end
174
-
175
- it "should raise an error if file is not leading with ./" do
176
- name = write_file
177
- code = execute "#{ name } "
178
- assert_equal 1 , code
179
-
180
- assert_equal [
181
- "Could not load file '#{ name } ': cannot load such file -- #{ name } " ,
182
- "Your file path should look like you're running a script, e.g. `./path/to/file.rb`"
183
- ] , output . messages
184
-
185
- assert_equal (
186
- { } ,
187
- LOADED_FILES
188
- )
189
- end
190
171
end
191
172
192
173
describe "should start up a locker" do
You can’t perform that action at this time.
0 commit comments