Cleanup of img_dir and testing of input_file.rb
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
require 'spec_helper'
|
||||
require 'squib/args/input_file'
|
||||
|
||||
describe Squib::Args::InputFile do
|
||||
subject(:ifile) {Squib::Args::InputFile.new}
|
||||
|
||||
context 'validate_file' do
|
||||
|
||||
it 'allows a file if it exists' do
|
||||
args = {file: __FILE__} # I code therefore I am.
|
||||
ifile.load!(args, expand_by: 1)
|
||||
expect(ifile).to have_attributes(file: [File.expand_path(__FILE__)])
|
||||
end
|
||||
|
||||
it 'raises on non-existent file' do
|
||||
args = {file: 'foo.rb'}
|
||||
expect { ifile.load!(args, expand_by: 1) }.to raise_error
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user