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
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/slim-3.0.6/test/core/test_tabs.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/slim-3.0.6/test/core/test_tabs.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/slim-3.0.6/test/core/test_tabs.rb
slim-3.0.6 test/core/test_tabs.rb
slim-3.0.3 test/core/test_tabs.rb
slim-3.0.2 test/core/test_tabs.rb
slim-3.0.1 test/core/test_tabs.rb
slim-3.0.0 test/core/test_tabs.rb
slim-3.0.0.beta.3 test/core/test_tabs.rb
slim-3.0.0.beta.2 test/core/test_tabs.rb