Skip to content

Commit b60306d

Browse files
committed
Remove ~/.mspecrc handling
* It seems unnecessary/unused. * It can cause issues, see #55
1 parent f8a5ced commit b60306d

File tree

2 files changed

+1
-13
lines changed

2 files changed

+1
-13
lines changed

lib/mspec/utils/script.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,7 @@ def try_load(target)
8484

8585
names.each do |name|
8686
config[:path].each do |dir|
87-
begin
88-
file = File.expand_path name, dir
89-
rescue ArgumentError => e
90-
# File.expand_path can issue error e.g. if HOME is not available
91-
warn "File.expand_path(#{name}, #{dir}) failed with: #{e}"
92-
next
93-
end
87+
file = File.expand_path name, dir
9488
if @loaded.include?(file)
9589
return true
9690
elsif File.exist? file
@@ -289,7 +283,6 @@ def self.main(child_process = true)
289283

290284
script = new
291285
script.load_default
292-
script.try_load '~/.mspecrc'
293286
script.options
294287
script.signals
295288
script.register

spec/utils/script_spec.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,6 @@ class MSSClass < MSpecScript; end
9696
MSpecScript.main
9797
end
9898

99-
it "attempts to load the '~/.mspecrc' script" do
100-
expect(@script).to receive(:try_load).with('~/.mspecrc')
101-
MSpecScript.main
102-
end
103-
10499
it "calls the #options method on the script" do
105100
expect(@script).to receive(:options)
106101
MSpecScript.main

0 commit comments

Comments
 (0)