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.2.1 test/test-applier.rb
rabbit-2.2.0 test/test-applier.rb
rabbit-2.1.9 test/test-applier.rb
rabbit-2.1.8 test/test-applier.rb
rabbit-2.1.7 test/test-applier.rb
rabbit-2.1.6 test/test-applier.rb
rabbit-2.1.5 test/test-applier.rb
rabbit-2.1.4 test/test-applier.rb
rabbit-2.1.3 test/test-applier.rb
rabbit-2.1.2 test/test-applier.rb
rabbit-2.1.1 test/test-applier.rb
rabbit-2.1.0 test/test-applier.rb
rabbit-2.0.9 test/test-applier.rb
rabbit-2.0.8 test/test-applier.rb
rabbit-2.0.7 test/test-applier.rb
rabbit-2.0.6 test/test-applier.rb
rabbit-2.0.5 test/test-applier.rb
rabbit-2.0.4 test/test-applier.rb
rabbit-2.0.3 test/test-applier.rb
rabbit-2.0.2 test/test-applier.rb