Sha256: 459b59f0ab57c9595bf8c151ec8c634308671247df6dd2f97a923810f1dd5153

Contents?: true

Size: 1.52 KB

Versions: 50

Compression:

Stored size: 1.52 KB

Contents

require 'helper'

class TestSlimTabs < TestSlim

  def teardown
    Slim::Engine.set_options tabsize: 4
  end

  def test_single_tab1_expansion

    Slim::Engine.set_options tabsize: 1

    source = %Q{
|
\t0
 \t1
  \t2
   \t3
    \t4
     \t5
      \t6
       \t7
        \t8
}

    result = %q{
0
 1
  2
   3
    4
     5
      6
       7
        8
}.strip

    assert_html result, source
  end

  def test_single_tab4_expansion

    Slim::Engine.set_options tabsize: 4

    source = %Q{
|
\t0
 \t1
  \t2
   \t3
    \t4
     \t5
      \t6
       \t7
        \t8
}

    result = %q{
0
1
2
3
    4
    5
    6
    7
        8
}.strip

    assert_html result, source
  end

  def test_multi_tab1_expansion

    Slim::Engine.set_options tabsize: 1

    source = %Q{
|
\t0
 \t\t1
 \t \t2
 \t  \t3
 \t   \t4
  \t\t1
  \t \t2
  \t  \t3
  \t   \t4
   \t\t1
   \t \t2
   \t  \t3
   \t   \t4
    \t\t1
    \t \t2
    \t  \t3
    \t   \t4
}

    result = %q{
0
  1
   2
    3
     4
   1
    2
     3
      4
    1
     2
      3
       4
     1
      2
       3
        4
}.strip

    assert_html result, source
  end

  def test_multi_tab4_expansion

    Slim::Engine.set_options tabsize: 4

    source = %Q{
|
\t0
 \t\t1
 \t \t2
 \t  \t3
 \t   \t4
  \t\t1
  \t \t2
  \t  \t3
  \t   \t4
   \t\t1
   \t \t2
   \t  \t3
   \t   \t4
    \t\t1
    \t \t2
    \t  \t3
    \t   \t4
}

    result = %q{
0
    1
    2
    3
    4
    1
    2
    3
    4
    1
    2
    3
    4
        1
        2
        3
        4
}.strip

    assert_html result, source
  end

end

Version data entries

50 entries across 50 versions & 5 rubygems

Version Path
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/slim-4.1.0/test/core/test_tabs.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/slim-4.1.0/test/core/test_tabs.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/slim-4.1.0/test/core/test_tabs.rb
slim-5.2.1 test/core/test_tabs.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/slim-4.1.0/test/core/test_tabs.rb
slim-5.2.0 test/core/test_tabs.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/slim-4.1.0/test/core/test_tabs.rb
slim-5.1.1 test/core/test_tabs.rb
slim-5.1.0 test/core/test_tabs.rb
slim-5.0.0 test/core/test_tabs.rb
slim-4.1.0 test/core/test_tabs.rb
slim-4.0.1 test/core/test_tabs.rb
slim-4.0.0 test/core/test_tabs.rb
brakeman-4.3.1 bundle/ruby/2.5.0/gems/slim-3.0.7/test/core/test_tabs.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/slim-3.0.7/test/core/test_tabs.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/slim-3.0.7/test/core/test_tabs.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/slim-3.0.7/test/core/test_tabs.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/slim-3.0.7/test/core/test_tabs.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/slim-3.0.7/test/core/test_tabs.rb
slim-3.0.9 test/core/test_tabs.rb