summaryrefslogtreecommitdiff
path: root/test/reader_test.rb
AgeCommit message (Collapse)Author
2017-12-23automatically set path in Reader#push_includeDan Allen
- if path is not specified but file is, default to basename of file
2017-12-18add test to verify tag filtering works for remote includesDan Allen
2017-12-17add test to verify local includes are resolved relative to current documentDan Allen
- complements the remote nested includes test
2017-12-17resolves #2506 resolve nested includes in remote documents relative to URI ↵Dan Allen
(PR #2511) - match behavior of resolving local nested includes - consistently set dir on Reader to '.' if file is not defined
2017-09-27use assert_includes in place of raw assertion in reader testsDan Allen
2017-09-22use assert_kind_of in place of assert ... is_a? in test suiteDan Allen
2017-09-19resolves #2389 allow local include to be flagged as optional (PR #2413)Dan Allen
2017-08-29peek all lines if no arguments are passed to peek_lines or first arg is nilDan Allen
2017-07-23use refute in place of assert ! in test suite (PR #2336)Dan Allen
- replace assert ! with refute - use assert_nil and refute_nil - use assert_empty and refute_empty - use assert_kind_of instead of direct is_a? call - use assert_respond_to instead of direct respond_to? call
2017-07-18change default argument values for Reader#peek_lines methodDan Allen
- make num arg required - change default value of direct flag to false to be consistent with peek_line
2017-07-18add additional tests to test behavior of Reader#peek_linesDan Allen
2017-07-08remove stray wip in test nameDan Allen
2017-07-02rename EOL constant to LF (PR #2289)Dan Allen
* name it for what it is
2017-06-29resolves #1983 fix operator logic in ifndef directive (PR #2283)Dan Allen
2017-06-26permit leading, trailing, and repeat operators in target of preprocessor ↵Dan Allen
conditional (#2279) - permit target to begin or end with operator - don't drop empty conditions as these should be considered - only call target.empty? once - optimize conditional stack size check - add tests
2017-06-24use render_embedded_string method instead of setting header_footer option to ↵Dan Allen
false
2017-06-24add missing assertions in reader testsDan Allen
2017-06-23trap and verify warnings in reader testsDan Allen
2017-06-20resolves #1729 add support for include tags in languages with only circumfix ↵Dan Allen
comments (#2199)
2017-06-16resolves #2146 process include directive in shorthand preprocessor ↵Dan Allen
conditional (PR #2260)
2017-05-28use lowercase letters for unicode escape in test suiteDan Allen
2017-05-18resolves #1516 add option to exclude tags when including file (PR #2196)Dan Allen
- in addition to including tags, add option to exclude tags using !name syntax - introduce wildcard for including all (*) or excluding all (!*) tags - introduce wildcard for selecting non-tagged lines (**) - don't select nested tags with wildcard if ancestor tag is excluded - warn if a mismatched or unexpected end tag is found - improve efficiency of detecting and processing tag directives - maintain a tag stack for handling nested tags - skip call to push_include if selected lines array is empty - ignore tag and tags attribute if empty (previously caused an infinite loop) - add tests for excluding tags
2017-05-15handle cases when there are no lines for include directive to selectDan Allen
- ignore empty lines attribute in include directive - don't call push_include if selected lines are empty - consolidate logic
2017-04-28allow normalize option to be set on PreprocessorReader; change default to falseDan Allen
2017-04-26don't increment line number if peek_lines overruns bufferDan Allen
2017-03-04use chr instead of [0..0] to get first characterDan Allen
2016-08-10change push_include method to support chaining (PR #1836)Dan Allen
2015-12-29remove trailing endlines in sourceDan Allen
2015-12-09resolves #1602 don't swallow trailing line when include file is not readableDan Allen
- don't swallow line after include when file is not readable - add test for when include file is not readable - rename replace_line to replace_next_line to make intent more clear - minor cleanups - fix tomdoc
2015-11-27explicitly test ifeval scenario raised in #1585Dan Allen
2015-07-02resolves #1387 resolve missing attribute in ifeval to empty stringDan Allen
- always resolve missing attribute in ifeval expression to empty string - add additional tests for ifeval - use negated == comparison instead of != for compatiblity - code cleanups and formatting
2014-10-12resolves #1144 fix includes that reference absolute Windows pathsDan Allen
- fix support for absolute Windows path as target of include directive - add test for include directive with absolute path target - add tests for UriSniffRx
2014-09-18resolves #1072 recognize include tag directives inside XML comments; add testDan Allen
2014-07-17resolves #1027 don't include lines that contain a tag directiveDan Allen
2014-07-15resolves #612 generate data uri for remote imageDan Allen
- generate data uri for remote image when data-uri & allow-uri-read are set - add content-type logic to test webserver - minor optimizations
2014-07-08fix tests on Ruby 1.8.7Dan Allen
2014-07-08use ip address instead of hostname in reader testDan Allen
2014-07-04resolves #530 support leveloffset on include directive and relative valuesDan Allen
2014-04-08tests: switch to minitestKen Dreyer
Ruby 1.9+ uses Minitest as the backend for Test::Unit. As of Minitest 5, the shim no longer supports Test::Unit::TestCase. Adjust the test suite to support Minitest 5's syntax. Minitest versions 4 and below do not support the newer Minitest::Test class that arrived in version 5. For that case, use the MiniTest::Unit::TestCase class as a fallback.
2014-03-01resolves #903 ignore case of attribute in conditional directivesDan Allen
2014-02-27make document parsing a discrete step, make Reader accessible as property on ↵Dan Allen
Document - pull parsing out of Document#initializer and make it a discrete step - don't parse Document on creation unless :parse option is true - make Reader accessible as a read-only property on Document - rewrite reader tests to use Reader created by Document - optimize access to instance variables in Document#initializer - use requested ERB implementation in TemplateConverter, add tests
2014-02-17use in-process web server for URI testsDan Allen
2014-02-17include directive fixesDan Allen
- correct path calculation in Opal - raise IOError on 404 response in Opal - print message in document when include is not resolved - chomp endlines from template result when running in Opal
2014-02-16merge pull request #852 from @bk2204Dan Allen
2014-02-16resolves #743 set defaults for file, path and dir in push_includeDan Allen
2014-02-16resolves #743 make Reader#push_include work without file / path infobrian m. carlson
2014-02-16resolves #804 rewrite extensions to support extension instancesDan Allen
- rewrite extensions to support extension instances - class names, class instances and blocks are supported for every kind of extension - document extension APIs - introduce DSL for configuring extensions - add named group registration - add require library flag, -r, to cli for custom requires - add convenience methods on extension processor for creating various nodes - support lamba as process method - move all DSL methods to DSL classes - allow extension group or extensions registry to be passed to document - rename name dsl method to named; add helper method to parse content - refactor extension in Rakefile to work with new extension API - document extension APIs, use methods to retrieve all extensions - add default content model map to simplify Block creation - allow subs to be overridden in block constructor - add content_model option for macros to disable attribute parsing - allow empty target for block macro - add name_positional_attributes alias to pos_attrs option - rename methods to import dsl, update docs - don't output style on open block if nil, add missing endlines - pass attributes to Processor#parse_content - clear attributes if no block is dropped, update default content model map - duplicate attributes passed to processor; change return nil to return - add create method for example - add caption based on presence of <context>-caption attribute - move image postprocessing to generic location - add extension tests and docs - optimizations: - replace more calls to .nil? with truth checks - remove duplicate lookup of source in constructor - optimize caption assignment - cache path resolver - change order of truths in reader and document
2014-02-05refactor unit tests so they work in RubyMineCharles Moulliard
- explicitly add the test and lib directory to the load path - switch to the project root before running tests - add UTF-8 encoding magic header to all test files - exclude .gem file at root of project (where RubyMine puts it) This commit was modified from the original pull request by @mojavelinux
2014-01-28additional optimizations and formattingDan Allen
2013-12-01resolves #824 handle BOM when normalizing sourceDan Allen
* Ruby >= 1.9 - use BOM to set encoding, then encode to UTF-8 * Ruby 1.8 - drop the UTF-8 BOM, ignore all others