texas 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/texas +6 -0
- data/contents/_chapter.md.erb +13 -0
- data/contents/_preambel.tex.erb +50 -0
- data/contents/master.tex.erb +7 -0
- data/lib/texas/build/base.rb +120 -0
- data/lib/texas/build/dry.rb +11 -0
- data/lib/texas/build/final.rb +7 -0
- data/lib/texas/build/task/add_default_templates_to_build_path.rb +22 -0
- data/lib/texas/build/task/base.rb +15 -0
- data/lib/texas/build/task/copy_contents_to_build_path.rb +31 -0
- data/lib/texas/build/task/open_pdf.rb +36 -0
- data/lib/texas/build/task/publish_pdf.rb +46 -0
- data/lib/texas/build/task/rewrite_marked_templates.rb +13 -0
- data/lib/texas/build/task/run_before_scripts.rb +22 -0
- data/lib/texas/build/task/run_master_template.rb +23 -0
- data/lib/texas/build.rb +15 -0
- data/lib/texas/core_ext/string.rb +132 -0
- data/lib/texas/core_ext.rb +1 -0
- data/lib/texas/option_parser.rb +175 -0
- data/lib/texas/runner.rb +71 -0
- data/lib/texas/task/base.rb +23 -0
- data/lib/texas/task/new.rb +18 -0
- data/lib/texas/task/watch.rb +39 -0
- data/lib/texas/task.rb +11 -0
- data/lib/texas/template/helper/base.rb +82 -0
- data/lib/texas/template/helper/info.rb +29 -0
- data/lib/texas/template/helper/md.rb +35 -0
- data/lib/texas/template/helper/tex.rb +83 -0
- data/lib/texas/template/helper.rb +6 -0
- data/lib/texas/template/runner/base.rb +70 -0
- data/lib/texas/template/runner/md.rb +16 -0
- data/lib/texas/template/runner/tex.rb +11 -0
- data/lib/texas/template/runner.rb +13 -0
- data/lib/texas/template.rb +62 -0
- data/lib/texas/version.rb +9 -0
- data/lib/texas.rb +18 -0
- data/spec/fixtures/basic/contents/contents.tex.erb +8 -0
- data/spec/fixtures/basic/figures/test_figure.png +0 -0
- data/spec/fixtures/basic-md/contents/contents.md.erb +1 -0
- data/spec/fixtures/basic-md/contents/contents.tex.should +3 -0
- data/spec/fixtures/basic-md/contents/input_template.md.erb +3 -0
- data/spec/fixtures/basic-tex/contents/contents.tex.erb +1 -0
- data/spec/fixtures/basic-tex/contents/contents.tex.should +1 -0
- data/spec/fixtures/basic-tex/contents/input_template.tex.erb +3 -0
- data/spec/fixtures/basic-tex/contents/input_template.tex.should +3 -0
- data/spec/fixtures/basic-tex/contents/unused_template.tex.erb +1 -0
- data/spec/fixtures/different-master-tex/contents/contents.tex.erb +1 -0
- data/spec/fixtures/different-master-tex/contents/contents.tex.should +1 -0
- data/spec/fixtures/different-master-tex/contents/master.tex.erb +9 -0
- data/spec/fixtures/different-master-tex/contents/master.tex.should +59 -0
- data/spec/fixtures/helper-methods-tex/contents/contents.tex.erb +7 -0
- data/spec/fixtures/helper-methods-tex/contents/contents.tex.should +7 -0
- data/spec/fixtures/helper-methods-tex/contents/input_template.tex.erb +5 -0
- data/spec/fixtures/helper-methods-tex/contents/input_template.tex.should +5 -0
- data/spec/fixtures/helper-methods-tex/contents/some_chapter/another_include.tex +1 -0
- data/spec/fixtures/helper-methods-tex/contents/some_chapter/test_include.tex.erb +7 -0
- data/spec/fixtures/helper-methods-tex/contents/some_chapter/test_include.tex.should +7 -0
- data/spec/fixtures/helper-methods-tex/contents/some_chapter.tex.erb +5 -0
- data/spec/fixtures/helper-methods-tex/contents/some_chapter.tex.should +5 -0
- data/spec/fixtures/helper-methods-tex/contents/template/helper/_some_partial.md.erb +1 -0
- data/spec/fixtures/helper-methods-tex/contents/template/helper/base.tex.erb +3 -0
- data/spec/fixtures/helper-methods-tex/contents/template/helper/base.tex.should +4 -0
- data/spec/fixtures/helper-methods-tex/contents/template/helper/info.md.erb +6 -0
- data/spec/fixtures/helper-methods-tex/contents/template/helper/info.tex.should +1 -0
- data/spec/fixtures/helper-methods-tex/contents/test_figure.tex.erb +1 -0
- data/spec/fixtures/helper-methods-tex/figures/test_figure.png +0 -0
- data/spec/fixtures/lib-helpers/contents/contents.tex.erb +3 -0
- data/spec/fixtures/lib-helpers/contents/contents.tex.should +3 -0
- data/spec/fixtures/lib-helpers/lib/helpers/document_helper.rb +7 -0
- data/spec/fixtures/lib-helpers/lib/init.rb +4 -0
- data/spec/fixtures/new/contents/contents.tex.erb +9 -0
- data/spec/fixtures/new/lib/helpers/document_helper.rb +11 -0
- data/spec/fixtures/new/lib/init.rb +4 -0
- data/spec/fixtures/prose/contents/chapter-1/01-some-scene.md +1 -0
- data/spec/fixtures/prose/contents/chapter-1/02-another-scene.md +1 -0
- data/spec/fixtures/prose/contents/chapter-1/03-and-another-scene.md +1 -0
- data/spec/fixtures/prose/contents/contents.md.erb +1 -0
- data/spec/fixtures/rerun/contents/contents.tex.erb +6 -0
- data/spec/fixtures/rerun/contents/contents.tex.should +4 -0
- data/spec/fixtures/texasrc/contents/contents.tex.erb +3 -0
- data/spec/fixtures/texasrc/contents/contents.tex.should +3 -0
- data/spec/spec_helper.rb +64 -0
- data/spec/texas/build_spec.rb +17 -0
- data/spec/texas/template/helper/info_spec.rb +41 -0
- data/spec/texas/template/runner_spec.rb +35 -0
- data/spec/texas/template_spec.rb +11 -0
- data/spec/texas_spec.rb +43 -0
- metadata +196 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module Texas
|
|
2
|
+
module Template
|
|
3
|
+
class << self
|
|
4
|
+
attr_accessor :handlers, :known_extensions
|
|
5
|
+
|
|
6
|
+
# Returns a template handler for the given filename
|
|
7
|
+
#
|
|
8
|
+
# Example:
|
|
9
|
+
# Template.handler("some_file.tex.erb")
|
|
10
|
+
# # => Template::Runner::TeX
|
|
11
|
+
#
|
|
12
|
+
def handler(filename)
|
|
13
|
+
Template.handlers.each do |pattern, klass|
|
|
14
|
+
return klass if filename =~ pattern
|
|
15
|
+
end
|
|
16
|
+
warning { "No template handler found for: #{filename}" }
|
|
17
|
+
Template::Runner::Base
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Registers a handler for the given template extensions
|
|
21
|
+
#
|
|
22
|
+
# Example:
|
|
23
|
+
# Template.register_handler %w(tex tex.erb), Template::Runner::TeX
|
|
24
|
+
#
|
|
25
|
+
def register_handler(extensions, handler_class)
|
|
26
|
+
extensions.each do |ext|
|
|
27
|
+
handlers[/\.#{ext}$/i] = handler_class
|
|
28
|
+
end
|
|
29
|
+
known_extensions.concat extensions
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def register_helper(klass)
|
|
33
|
+
Template::Runner::Base.__send__ :include, klass
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def create(filename, build)
|
|
37
|
+
handler(filename).new(filename, build)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns the filename without the template extension
|
|
41
|
+
#
|
|
42
|
+
# Example:
|
|
43
|
+
# input_path("/home/rene/github/sample_project/tmp/build/chapter-01/contents.md.erb")
|
|
44
|
+
# # => "/home/rene/github/sample_project/tmp/build/chapter-01/contents"
|
|
45
|
+
#
|
|
46
|
+
def basename(filename)
|
|
47
|
+
value = filename
|
|
48
|
+
known_extensions.each do |str|
|
|
49
|
+
value = value.gsub(/\.#{str}$/, '')
|
|
50
|
+
end
|
|
51
|
+
value
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
Texas::Template.handlers = {}
|
|
59
|
+
Texas::Template.known_extensions = []
|
|
60
|
+
|
|
61
|
+
require_relative 'template/helper'
|
|
62
|
+
require_relative 'template/runner'
|
data/lib/texas.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module Texas
|
|
2
|
+
class << self
|
|
3
|
+
attr_accessor :contents_subdir_name, :texas_dir
|
|
4
|
+
attr_accessor :verbose, :warnings
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
Texas.texas_dir = File.join(File.dirname(__FILE__), '..')
|
|
8
|
+
Texas.contents_subdir_name = "contents"
|
|
9
|
+
|
|
10
|
+
require 'pp'
|
|
11
|
+
|
|
12
|
+
require_relative 'texas/option_parser'
|
|
13
|
+
require_relative 'texas/build'
|
|
14
|
+
require_relative 'texas/core_ext'
|
|
15
|
+
require_relative 'texas/task'
|
|
16
|
+
require_relative 'texas/template'
|
|
17
|
+
require_relative 'texas/version'
|
|
18
|
+
require_relative 'texas/runner'
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= render "input_template" %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= input "input_template" %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
\input{input_template}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This template is never used!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Hello World!
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Hello World!
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
\documentclass[a4paper,parskip=half*,12pt]{scrartcl}
|
|
2
|
+
|
|
3
|
+
\usepackage{relsize}
|
|
4
|
+
|
|
5
|
+
\usepackage{amsmath,amstext,amssymb}
|
|
6
|
+
|
|
7
|
+
\usepackage[ngerman]{babel}
|
|
8
|
+
\usepackage[utf8]{inputenc}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
\usepackage{courier}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
\usepackage[T1]{fontenc}
|
|
16
|
+
|
|
17
|
+
\usepackage[table]{xcolor}
|
|
18
|
+
\usepackage{color}
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
\usepackage{url,hyperref}
|
|
22
|
+
\urlstyle{same}
|
|
23
|
+
|
|
24
|
+
\usepackage{setspace}
|
|
25
|
+
|
|
26
|
+
\clubpenalty = 10000
|
|
27
|
+
\widowpenalty = 10000
|
|
28
|
+
\displaywidowpenalty = 10000
|
|
29
|
+
|
|
30
|
+
\setlength{\parindent}{1em}
|
|
31
|
+
|
|
32
|
+
\setcounter{secnumdepth}{0}
|
|
33
|
+
\setcounter{tocdepth}{0}
|
|
34
|
+
|
|
35
|
+
\usepackage{fancyhdr}
|
|
36
|
+
\pagestyle{fancy}
|
|
37
|
+
|
|
38
|
+
\fancyhead{}
|
|
39
|
+
\fancyfoot{}
|
|
40
|
+
|
|
41
|
+
\fancyhead[L]{ -- }
|
|
42
|
+
\fancyhead[C]{}
|
|
43
|
+
\fancyhead[R]{}
|
|
44
|
+
|
|
45
|
+
\fancyfoot[L]{}
|
|
46
|
+
\fancyfoot[C]{}
|
|
47
|
+
\fancyfoot[R]{\thepage}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
\onehalfspacing
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
\begin{document}
|
|
54
|
+
|
|
55
|
+
THIS IS A DIFFERENT MASTER.TEX!
|
|
56
|
+
|
|
57
|
+
\input{contents}
|
|
58
|
+
|
|
59
|
+
\end{document}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This file is a static .tex file.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Should find this template relatively and render the template another\_include below:
|
|
2
|
+
|
|
3
|
+
<%= render "another_include" %>
|
|
4
|
+
|
|
5
|
+
When using the LaTeX input command, the path should be relative to master.tex e.g. some\_chapter/another\_include
|
|
6
|
+
|
|
7
|
+
<%= input "another_include" %>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Should find this template relatively and render the template another\_include below:
|
|
2
|
+
|
|
3
|
+
This file is a static .tex file.
|
|
4
|
+
|
|
5
|
+
When using the LaTeX input command, the path should be relative to master.tex e.g. some\_chapter/another\_include
|
|
6
|
+
|
|
7
|
+
\input{some_chapter/another_include}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This is foo <%= o.foo %>.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Some content \ldots{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= figure :test_figure, :caption => "This should be a caption to a figure." %>
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
This is a sample <%= b "TeX" %> document.
|
|
2
|
+
|
|
3
|
+
TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as TEX.
|
|
4
|
+
|
|
5
|
+
Together with the Metafont language for font description and the Computer Modern family of typefaces, TeX was designed with two main goals in mind: to allow anybody to produce high-quality books using a reasonably minimal amount of effort, and to provide a system that would give exactly the same results on all computers, now and in the future.
|
|
6
|
+
|
|
7
|
+
TeX is a popular means by which to typeset complex mathematical formulae; it has been noted as one of the most sophisticated digital typographical systems in the world.[3] TeX is popular in academia, especially in mathematics, computer science, economics, engineering, physics, statistics, and quantitative psychology. It has largely displaced Unix troff, the other favored formatter, in many Unix installations, which use both for different purposes. It is also used for many other typesetting tasks, especially in the form of LaTeX and other template packages.
|
|
8
|
+
|
|
9
|
+
The widely used MIME type for TeX is application/x-tex. TeX is free software.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Lorem ipsum 1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Lorem ipsum 2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Lorem ipsum 3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= chapter :title => "Lorem", :glob => "chapter-1/*" %>
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env ruby -wKU
|
|
2
|
+
|
|
3
|
+
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
|
|
4
|
+
|
|
5
|
+
require 'rspec'
|
|
6
|
+
require 'fileutils'
|
|
7
|
+
|
|
8
|
+
require 'texas'
|
|
9
|
+
|
|
10
|
+
def default_options
|
|
11
|
+
{:open_pdf => false, :warnings => false}
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def rebuild_test_data_dir!(scenario)
|
|
15
|
+
FileUtils.rm_rf test_data_dir(scenario)
|
|
16
|
+
FileUtils.mkdir_p test_data_dir(scenario)
|
|
17
|
+
|
|
18
|
+
source_dir = original_test_data_dir(scenario)
|
|
19
|
+
FileUtils.cp_r(source_dir, tmp_dir)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def original_test_data_dir(scenario)
|
|
23
|
+
File.join(File.dirname(__FILE__), 'fixtures', scenario.to_s)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def test_data_dir(scenario)
|
|
27
|
+
File.join(tmp_dir, scenario.to_s)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def tmp_dir
|
|
31
|
+
File.join(File.dirname(__FILE__), '..', 'tmp')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def use_scenario(scenario)
|
|
35
|
+
rebuild_test_data_dir! scenario
|
|
36
|
+
Dir.chdir test_data_dir(scenario)
|
|
37
|
+
Dir.pwd
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def run_scenario(scenario, options = {}, &block)
|
|
41
|
+
options = default_options.merge(options)
|
|
42
|
+
work_dir = use_scenario(scenario)
|
|
43
|
+
runner = Texas::Runner.new(options)
|
|
44
|
+
if block_given?
|
|
45
|
+
yield runner
|
|
46
|
+
else
|
|
47
|
+
match_should_templates work_dir
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def match_should_templates(work_dir)
|
|
52
|
+
should_templates = Dir[File.join(work_dir, "tmp", "build", "**/*.tex.should")]
|
|
53
|
+
should_templates.each do |should_file|
|
|
54
|
+
generated_file = should_file.gsub(/\.should$/, '')
|
|
55
|
+
File.read(generated_file).should == File.read(should_file)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
RSpec.configure do |config|
|
|
60
|
+
config.before(:each) {
|
|
61
|
+
# rebuild_test_data_dir!
|
|
62
|
+
# Dir.chdir(test_data_dir)
|
|
63
|
+
}
|
|
64
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe Texas::Build::Base do
|
|
4
|
+
describe "#ran_templates" do
|
|
5
|
+
|
|
6
|
+
it "returns the templates" do
|
|
7
|
+
run_scenario "basic-md" do |runner|
|
|
8
|
+
build = runner.task_instance
|
|
9
|
+
filenames = build.ran_templates.map(&:filename)
|
|
10
|
+
basenames = filenames.map { |f| f.gsub(build.__path__+'/', '') }
|
|
11
|
+
basenames.size.should > 0
|
|
12
|
+
basenames.include?("unused_template.tex.erb").should == false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe Texas::Template::Runner::Base do
|
|
4
|
+
|
|
5
|
+
def test_template(_runner)
|
|
6
|
+
build = _runner.task_instance
|
|
7
|
+
template_filename = File.join(build.__path__, "contents.tex.erb")
|
|
8
|
+
Texas::Template.create( template_filename, build )
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe "#info" do
|
|
12
|
+
it "should return an info object for the given template" do
|
|
13
|
+
run_scenario "basic" do |runner|
|
|
14
|
+
template = test_template(runner)
|
|
15
|
+
template.__run__
|
|
16
|
+
template.info.should_not be_nil
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe "#abstract" do
|
|
22
|
+
it "should return an info object for the given template" do
|
|
23
|
+
run_scenario "basic" do |runner|
|
|
24
|
+
template = test_template(runner)
|
|
25
|
+
template.__run__
|
|
26
|
+
template.abstract.should == "This is a one-liner to describe the contents of this template"
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
describe "#summary" do
|
|
32
|
+
it "should return an info object for the given template" do
|
|
33
|
+
run_scenario "basic" do |runner|
|
|
34
|
+
template = test_template(runner)
|
|
35
|
+
template.__run__
|
|
36
|
+
template.summary.should == "This is a more elaborate summary of the contents of this template!"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe Texas::Template::Runner::Base do
|
|
4
|
+
|
|
5
|
+
def test_template(_runner)
|
|
6
|
+
build = _runner.task_instance
|
|
7
|
+
template_filename = File.join(build.__path__, "contents.tex.erb")
|
|
8
|
+
Texas::Template.create( template_filename, build )
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
describe "#__path__" do
|
|
12
|
+
it "should return the absolute path of the given template" do
|
|
13
|
+
run_scenario "basic" do |runner|
|
|
14
|
+
build = runner.task_instance
|
|
15
|
+
template = test_template(runner)
|
|
16
|
+
template.__path__.should == build.__path__
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe "#find_template_file" do
|
|
22
|
+
it "should return the absolute path of found image" do
|
|
23
|
+
run_scenario "basic" do |runner|
|
|
24
|
+
build = runner.task_instance
|
|
25
|
+
work_dir = build.root
|
|
26
|
+
template = test_template(runner)
|
|
27
|
+
|
|
28
|
+
found_location = template.find_template_file(["figures", "test_figure"], [:pdf, :png])
|
|
29
|
+
image_file_location = File.join(work_dir, "figures", "test_figure.png")
|
|
30
|
+
found_location.should == image_file_location
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe Texas::Template::Runner do
|
|
4
|
+
describe ".basename" do
|
|
5
|
+
|
|
6
|
+
it "returns the path without the known extensions" do
|
|
7
|
+
Texas::Template.basename("some_path/some_file.tex.erb").should == "some_path/some_file"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
end
|
|
11
|
+
end
|
data/spec/texas_spec.rb
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
|
+
|
|
3
|
+
describe Texas::Runner do
|
|
4
|
+
describe "#initialize" do
|
|
5
|
+
|
|
6
|
+
it "run basic tex scenario" do
|
|
7
|
+
run_scenario "basic-tex"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "run basic markdown scenario" do
|
|
11
|
+
run_scenario "basic-md"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "run scenario with different master file" do
|
|
15
|
+
run_scenario "different-master-tex"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it "run scenario for TeX helper methods" do
|
|
19
|
+
run_scenario "helper-methods-tex"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "run scenario for .texasrc" do
|
|
23
|
+
run_scenario "texasrc"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "run scenario for lib/ helpers" do
|
|
27
|
+
run_scenario "lib-helpers"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "run scenario for rerun" do
|
|
31
|
+
run_scenario "rerun"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
it "run scenario for --new" do
|
|
35
|
+
run_scenario "new"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
it "run scenario for prose" do
|
|
39
|
+
run_scenario "prose"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
43
|
+
end
|