diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2019-01-03 18:02:02 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2019-01-06 15:40:01 -0700 |
| commit | 67ec4dc95522e4e6ca4f70009fadc9cbe71b4446 (patch) | |
| tree | 7009c916dfae16efa1269c29beaa2bbbc84d21d2 /test/parser_test.rb | |
| parent | 860b9aa494c0a4f41b0771ad5d4093620ebed27b (diff) | |
remove workarounds for Ruby < 2.3
- 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
Diffstat (limited to 'test/parser_test.rb')
| -rw-r--r-- | test/parser_test.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/test/parser_test.rb b/test/parser_test.rb index 2e96bef1..59c67ec6 100644 --- a/test/parser_test.rb +++ b/test/parser_test.rb @@ -1,4 +1,3 @@ -# encoding: UTF-8 unless defined? ASCIIDOCTOR_PROJECT_DIR $: << File.dirname(__FILE__); $:.uniq! require 'test_helper' @@ -298,7 +297,7 @@ context "Parser" do assert_equal 'Stéphane', metadata['firstname'] assert_equal 'Brontë', metadata['lastname'] assert_equal 'SB', metadata['authorinitials'] - end if ::RUBY_MIN_VERSION_1_9 + end test 'parse ideographic author names' do metadata, _ = parse_header_metadata '李 四 <si.li@example.com>' @@ -310,7 +309,7 @@ context "Parser" do assert_equal '四', metadata['lastname'] assert_equal 'si.li@example.com', metadata['email'] assert_equal '李四', metadata['authorinitials'] - end if ::RUBY_MIN_VERSION_1_9 + end test "parse author condenses whitespace" do metadata, _ = parse_header_metadata ' Stuart Rackham <founder@asciidoc.org>' @@ -710,7 +709,7 @@ devtmpfs 3.9G 0 3.9G 0% /dev expected = input - lines = input.lines.entries + lines = input.lines Asciidoctor::Parser.adjust_indentation! lines, -1 assert_equal expected, lines.join end |
