1require 'tmpdir' 2require 'fileutils' 3require 'yaml' 4 5Given /^I set up the environment for texhyphen$/ do 6 texhyphdir = File.expand_path('../../../../..', __FILE__) 7 unless File.file?("#{texhyphdir}/trunk/hyph-utf8/tex/generic/hyph-utf8/patterns/tex/hyph-sl.tex") 8 puts "Could not the tex-hyphen root." 9 exit(-1) 10 end 11 ENV['TEXINPUTS'] = "#{texhyphdir}/trunk/hyph-utf8/tex/generic//:#{texhyphdir}/trunk/TL/texmf-dist/tex/generic/config:" 12end 13 14When /^I make the format for (.*?)$/ do |format| 15 @format = format 16 @tmpdir = Dir.mktmpdir 17 FileUtils.chdir(@tmpdir) 18 arg = if format =~ /^xe/ then "-etex" else "" end 19 `#{format} -interaction=nonstopmode #{arg} -ini #{format}.ini` 20end 21 22Then /^it should make a format file$/ do 23 File.file?("#{@format}.fmt").should be_true 24 FileUtils.rmtree(@tmpdir) 25end 26