Sha256: b3198346f28ac4732d6df0d0e7c87925f5d05cba8f27444a7022873f76cb8c5c
Contents?: true
Size: 1.04 KB
Versions: 1
Compression:
Stored size: 1.04 KB
Contents
# encoding: utf-8 require_relative '../../spec_helper' describe Arachni::Module::Utilities do before( :all ) do @utils = Arachni::Module::Utilities end describe '#read_file' do it 'reads a file from a directory with the same name as the caller and return an array of stripped lines' do filename = 'read_file.txt' filepath = File.expand_path( File.dirname( __FILE__ ) ) + '/utilities_spec/' + filename @utils.read_file( filename ).join( "\n" ).should == IO.read( filepath ).strip end context 'if a block is given' do it 'reads a file from a directory with the same name as the caller one stripped line at a time' do filename = 'read_file.txt' filepath = File.expand_path( File.dirname( __FILE__ ) ) + '/utilities_spec/' + filename lines = [] @utils.read_file( filename ){ |line| lines << line } lines.join( "\n" ).should == IO.read( filepath ).strip end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
arachni-0.4.2 | spec/arachni/module/utilities_spec.rb |