Before do FileUtils.mkdir(TEST_DIR) Dir.chdir(TEST_DIR) end After do FileUtils.rm_rf(TEST_DIR) FileUtils.rm_rf(JEKYLL_COMMAND_OUTPUT_FILE) end World(Test::Unit::Assertions) Given /^I have a blank site in "(.*)"$/ do |path| FileUtils.mkdir_p(path) end Given /^I do not have a "(.*)" directory$/ do |path| File.directory?("#{TEST_DIR}/#{path}") end # Like "I have a foo file" but gives a yaml front matter so jekyll actually processes it Given /^I have an? "(.*)" page(?: with (.*) "(.*)")? that contains "(.*)"$/ do |file, key, value, text| File.open(file, 'w') do |f| f.write <