Added specific error to spec.
This commit is contained in:
@@ -138,7 +138,7 @@ class Browser
|
|||||||
@config_file = config_file || @config_file
|
@config_file = config_file || @config_file
|
||||||
|
|
||||||
if File.symlink?(@config_file)
|
if File.symlink?(@config_file)
|
||||||
raise "[ERROR] #{config_file} is a symlink."
|
raise "[ERROR] Config file is a symlink."
|
||||||
else
|
else
|
||||||
data = JSON.parse(File.read(@config_file))
|
data = JSON.parse(File.read(@config_file))
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ describe Browser do
|
|||||||
browser = Browser.instance
|
browser = Browser.instance
|
||||||
|
|
||||||
File.symlink('./testfile', symlink)
|
File.symlink('./testfile', symlink)
|
||||||
expect { browser.load_config(symlink) }.to raise_error
|
expect { browser.load_config(symlink) }.to raise_error("[ERROR] Config file is a symlink.")
|
||||||
File.unlink(symlink)
|
File.unlink(symlink)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user