# encoding: utf-8 Given(/^a configuration file named "([^"]*?)" with:$/) do |file, table| result = [] result << '---' with_environment 'HOME' => working_directory do table.hashes.each do |r| r['value'] = ::File.expand_path(r['value']) if r['option'].split(/ /).include? 'resolve_path' result << "#{r['parameter']}: #{r['value']}" end end write_file(file, result.join("\n")) end Given(/^a repository named "(.*?)" with$/) do |repository, table| repository = GitRepository.create File.join(current_dir, repository) table.hashes.each do |r| repository.add_content r[:path], r[:content] end end Then(/^a repository named "(.*?)" should exist$/) do |repository| in_current_dir do with_environment 'HOME' => working_directory do expect(File.exist? File.expand_path(repository)).to be_truthy end end end