require 'fakefs/spec_helpers' require 'spec_helper' require 'meetupinator/input_file_reader' describe Meetupinator::InputFileReader do include FakeFS::SpecHelpers::All let(:input_file_dir) { '/tmp/input/file/location' } let(:file_name) { input_file_dir + '/input_file.txt' } let(:group_names) { %w(some_group another_group more_groups) } before do # need to make dir for fakefs FileUtils.mkdir_p(input_file_dir) File.open(file_name, 'wb') do |file| group_names.each { |items| file << items + "\n" } end end describe '#group_names' do it { expect(Meetupinator::InputFileReader.group_names(file_name)).to eq(group_names) } end end