Sha256: dff59e061563604708e808707f12d11fde6c78dd3469cd0bfce78dda25e8c9a2

Contents?: true

Size: 616 Bytes

Versions: 3

Compression:

Stored size: 616 Bytes

Contents

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("File #{File.expand_path('foo.rb')} does not exist!")
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.12.0 spec/args/input_file_spec.rb
squib-0.11.0 spec/args/input_file_spec.rb
squib-0.10.0 spec/args/input_file_spec.rb