summaryrefslogtreecommitdiff
path: root/test/paths_test.rb
AgeCommit message (Collapse)Author
2023-04-30resolves #3929 treat uri:classloader: as absolute path prefix when running ↵Dan Allen
on JRuby (PR #4444)
2022-01-11don't overqualify types in test suiteDan Allen
2021-12-23Fix typos and misspellings in docs and code (PR #4222)Kian Meng, Ang
2021-07-31omit_parentheses where possible in test codeDan Allen
2021-06-08use assert_raises in test suite where possibleDan Allen
2021-05-31use appropriate assertions in test suiteDan Allen
- assert_equal instead of == - assert instead of assert_equal true - refute instead of assert_equal false - specify literal value as first argument to assert_equal
2021-05-25use single-quoted strings where possible in test suiteDan Allen
2021-04-30leave empty line after magic comment [skip ci]Dan Allen
2020-11-09add if and unless conditions to tests to make filtering more readable (PR #3844)Dan Allen
- also define windows? as static method for these cases - don't match darwin when detecting Windows
2019-02-12rename Helpers.uri_encode to Helpers.encode_uri_component and use native ↵Dan Allen
function (PR #3015) - rename Helpers.uri_encode to Helpers.encode_uri_component (to borrow terminology from JavaScript) - implement Helpers.encode_uri_component using CGI.escape in *Ruby and encodeURIComponent in Opal - which characters are encoded now complies with RFC-3986 - move Helpers tests to helpers_test.rb
2019-02-10resolves #3054 never mutate strings; add `frozen_string_literal: true` ↵Dan Allen
comment to source files (PR #3055) - replace gsub! and sub! with gsub and sub, respectively - add `frozen_string_literal: true` magic comment to all Ruby source files - see https://www.mikeperham.com/2018/02/28/ruby-optimization-with-one-magic-comment/
2019-01-06switch to modern hash syntaxDan Allen
- switch to modern hash syntax (from :key => value to key: value) - put space inside hash brackets (from {key: value} to { key: value } - use dangling comma on last entry of multi-line hash
2019-01-06use require_relative instead of modifying $LOAD_PATHDan Allen
- use require_relative in place of require when it relied on $LOAD_PATH manipulation - configure bin scripts to work with require_relative - rename ROOT_PATH to ROOT_DIR - rename DATA_PATH to DATA_DIR - rename STYLESHEETS_DATA_PATH to STYLESHEETS_DIR - define LIB_DIR - simplify test helper require and setup - add bindir helper to test suite - remove unneeded constants in test helper - reorder autoload statements - require version directly instead of autoloading
2019-01-06remove workarounds for Ruby < 2.3Dan Allen
- remove constants for differentiating between Ruby versions - remove fallback assignment for RUBY_ENGINE constant - remove rubygems require - use unicode character properties in regular expressions (e.g., \p{Word}) - remove COERCE_ENCODING constant - always set FORCE_ENCODING constant to true unless default external encoding is not UTF-8 - remove workaround for computing line length - use lines method instead of lines.entries to get lines for string - always normalize lines - check if JRuby class is defined instead of checking for JRuby engine - remove global RUBY_ENGINE_JRUBY constant - move RUBY_ENGINE_OPAL constant inside Asciidoctor module - remove magic encoding comments (since default script encoding is UTF-8) - remove workaround when printing encoding information - remove fallback assignments for passthrough escape characters - remove Ruby core backports (only leave Asciidoctor-specific extensions) - use __dir__ instead of File.dirname __FILE__ - use Float#truncate to truncate column widths - override Float#truncate on Ruby 2.3 to implement precision argument - remove concurrent/hash backport - simplify class_for_name helper - don't call to_sym on constants returned from constants method - remove unnecessary aliasing of regexp match variables; use magic variable instead (e.g., m = $~) - remove workaround for sub_specialchars to accomodate gsub with map argument - remove comment about %:z placeholder for strftime - don't call .to_a on return value of Hash#keys - get home directory using Dir.home - remove exceptions and exclusions for Ruby < 2 in test suite - update list of supported Ruby engines and versions in READMEs - update ruby versions in run-tests.sh
2018-11-01resolves #2944 add fallback if relative path cannot be computed (PR #2945)Dan Allen
2018-10-26resolves #2108 use Pathname to resolve relative path for file outside base ↵Dan Allen
directory (PR #2748) - autoload pathname - use Pathname#relative_path_from to resolve path outside base directory - add test
2018-09-18resolves #2869 preserve UNC path with backslashes on WindowsDan Allen
- convert system path \\server\docs to //server/docs on Windows - clarify that PathResolver#root? does not require path to be posixified
2018-09-18assert that File.dirname preserves UNC path root on WindowsDan Allen
2018-09-18add test to verify UNC path is preserved by PathResolver#system_pathDan Allen
2018-04-27use consistent phrase to indicate the processor is automatically recovering ↵Dan Allen
from a problem (PR #2726)
2018-04-14use helpers to assert log messages in testsDan Allen
- add assert_message helper for asserting a single message - add assert_messages helper for asserting multiple messages - rewrite paths and reader tests to assert log messages instead of stderr stream - assert message about illegal reference to parent is only reported on first violation when resolving system path - use instance variable to store shared logger in tests
2018-04-11fix PathResolver#descends_from? when base is /Dan Allen
2018-04-11allow target to bring resolved path under jail when start is outside jailDan Allen
2018-04-11resolves #2642 resolve parent references in start path when resolving system ↵Dan Allen
path
2018-04-11change PathResolver#expand_path to resolve parent referencesDan Allen
2018-04-03assert that PathResolver#system_path removes self references in start pathDan Allen
2017-09-23set file separator correctly for windows path testsDan Allen
2017-07-23resolves #2107 calculate relative path correctly (PR #2335)Dan Allen
- return filename as relative path if filename doesn't share common root with base directory - add test for scenario
2017-06-25remove trailing spacesDan Allen
2017-06-20trap and verify warnings in path testsDan Allen
2017-01-02rename posixfy to posixify (alias old method)Dan Allen
2016-12-13resolves #1965 make start argument to system_path optional (PR #1966)Dan Allen
2016-11-29resolves #1943 allow spaces in target of block image (PR #1947)Dan Allen
- allow spaces in target of block image - URL encode spaces in image URI (replace space with %20) - add test
2016-07-27don't duplicate forward slash for path relative to root (PR #1822)Dan Allen
2014-11-20resolves #1192 preserve URI targets universallyDan Allen
- preserve URI targets universally by moving logic to normalize_web_path - remove pre-checks for URI whereever normalize_web_path is used
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-07-30resolves #690 resolve relative paths relative to base_dir in unsafe modeDan Allen
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-28cleanup and optimize path resolverDan Allen
- store actual root when partitioning - handle dot directory correctly - memoize partition_path - add is_unc? method - optimize and format code
2014-01-28resolves #806 recognize Windows UNC path as absolute and preserve itDan Allen
2013-08-22extension improvementsDan Allen
- make Preprocessor operate on Reader instead of just lines - add template_name to Inline; make property writable for all node types - add a finalize_header method to handle preparing to parse body - spec out idea for preserialize processor - update tests
2013-08-21introduce method to calc path relative to base_dirDan Allen
2013-07-03resolves #470 allow uri to be used in inline imageDan Allen
- don't mangle imagesdir value if its a uri
2013-05-16resolves #330 fix file path resolution on windowsDan Allen
- check for proper separator on Windows - force all paths to use forward slash (posix), as Ruby can handle it
2013-04-25resolves #76 add a default stylesheetDan Allen
- add a default stylesheet, asciidoctor.css, to stylesheets directory - add copycss attribute to control copying default stylesheet to outdir - add linkcss attribute to control stylesheet embedding - use default stylesheet by default w/ linkcss enabled - rewrite path logic to be more secure, deterministic and OS independent - switch all path resolution to use new path resolver - add path resolver tests - refactor cli invoker to use render API - add timing monitor to load and render APIs - fix image path resolution to be secure - add tests for embedded attribute