spec/lib/command_line_spec.rb in erbtex-0.3.0 vs spec/lib/command_line_spec.rb in erbtex-0.4.1

- old
+ new

@@ -16,10 +16,21 @@ -mltex -nomktex tfm -ouptput-comment This\ is\ a\ long\ comment -output-directory ~/texmf/tex -parse-first-line -progname pdflatex -recorder -shell-escape -src-specials cr,display,hbox,math,par -translate-file willy -version &myformat file_name.tex.erb ) + @argv_with_invoke_and_file = + %w( + --invoke=lualatex + -draftmode -enc -etex -file-line-error -fmt junk + -halt-on-error -ini -interaction batchmode -ipc -ipc-start + -jobname junk -kpathsea-debug 8 -mktex tex --invoke=pdflatex + -mltex -nomktex tfm -ouptput-comment This\ is\ a\ long\ comment + -output-directory ~/texmf/tex -parse-first-line -progname pdflatex + -recorder -shell-escape -src-specials cr,display,hbox,math,par + -translate-file willy -version &myformat file_name.tex.erb + ) @argv_with_cmds = %w( -draftmode -enc -etex -file-line-error -fmt junk -halt-on-error -ini -interaction batchmode -ipc -ipc-start -jobname junk -kpathsea-debug 8 -mktex tex --invoke=pdflatex @@ -47,9 +58,25 @@ expect(cl.erbtex_name).to eq('erbtex') expect(cl.tex_program).to eq('pdflatex') expect(cl.input_file).to eq('file_name.tex.erb') expect(cl.tex_command).to eq(<<~'EOS'.tr("\n", ' ').strip) pdflatex -draftmode -enc -etex -file-line-error -fmt junk -halt-on-error + -ini -interaction batchmode -ipc -ipc-start -jobname junk -kpathsea-debug 8 + -mktex tex -mltex -nomktex tfm + -ouptput-comment This\ is\ a\ long\ comment + -output-directory \~/texmf/tex -parse-first-line -progname pdflatex + -recorder -shell-escape -src-specials cr,display,hbox,math,par + -translate-file willy -version \&myformat file_name.tex.erb + EOS + end + + it 'parse command line with invoke and file name' do + cl = CommandLine.new(@argv_with_invoke_and_file) + expect(cl.erbtex_name).to eq('erbtex') + expect(cl.tex_program).to eq('lualatex') + expect(cl.input_file).to eq('file_name.tex.erb') + expect(cl.tex_command).to eq(<<~'EOS'.tr("\n", ' ').strip) + lualatex -draftmode -enc -etex -file-line-error -fmt junk -halt-on-error -ini -interaction batchmode -ipc -ipc-start -jobname junk -kpathsea-debug 8 -mktex tex -mltex -nomktex tfm -ouptput-comment This\ is\ a\ long\ comment -output-directory \~/texmf/tex -parse-first-line -progname pdflatex -recorder -shell-escape -src-specials cr,display,hbox,math,par