Sha256: 964ab292506ea62e8f45bb82a1544159af26583914ec1c25e86ba3b15eb20a52

Contents?: true

Size: 1.26 KB

Versions: 39

Compression:

Stored size: 1.26 KB

Contents

require 'fileutils'

require "rabbit-test-utils"

require "rabbit/theme/applier"

class RabbitApplierTest < Test::Unit::TestCase
  def test_normalize_source
    assert_normalize_source_ivar("x_large_font_size", "huge_font_size")
    assert_normalize_source_ivar("xx_large_font_size", "very_huge_font_size")
    assert_normalize_source_ivar("x_large_script_font_size",
                                 "huge_script_font_size")
  end

  def normalize_source(src)
    dummy = Object.new
    def dummy.slides
      Object.new
    end
    Rabbit::Theme::Applier.new(dummy).__send__(:normalize_source, src)
  end

  def assert_normalize_source(expected, src)
    _wrap_assertion do
      assert_equal(expected, normalize_source(src))
    end
  end

  def assert_normalize_source_ivar(after, before)
    _wrap_assertion do
      assert_normalize_source("@#{after}", "@#{before}")
      assert_normalize_source("@#{after}=111",
                              "@#{before}=111")
      assert_normalize_source("@#{after} = 111",
                              "@#{before} = 111")
      assert_normalize_source("(@#{after})",
                              "(@#{before})")
      assert_normalize_source("(xxx, @#{after}, xxx)",
                              "(xxx, @#{before}, xxx)")
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
rabbit-2.0.1 test/test_applier.rb
rabbit-2.0.0 test/test_applier.rb
rabbit-1.0.9 test/test_applier.rb
rabbit-1.0.8 test/test_applier.rb
rabbit-1.0.7 test/test_applier.rb
rabbit-1.0.6 test/test_applier.rb
rabbit-1.0.5 test/test_applier.rb
rabbit-1.0.4 test/test_applier.rb
rabbit-1.0.3 test/test_applier.rb
rabbit-1.0.2 test/test_applier.rb
rabbit-1.0.1 test/test_applier.rb
rabbit-1.0.0 test/test_applier.rb
rabbit-0.9.3 test/test_applier.rb
rabbit-0.9.2 test/test_applier.rb
rabbit-0.9.1 test/test_applier.rb
rabbit-0.9.0 test/test_applier.rb
rabbit-0.6.4 test/test_applier.rb
rabbit-0.6.3 test/test_applier.rb
rabbit-0.6.2 test/test_applier.rb