Sha256: fca21a34304211002bcb1adcf26a193e083714eba91db972d5bb36a048551959

Contents?: true

Size: 1.62 KB

Versions: 37

Compression:

Stored size: 1.62 KB

Contents

# Copyright (C) 2013  Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

class TestConfiguration < Test::Unit::TestCase
  def setup
    @configuration = ChupaText::Configuration.new
    @loader = ChupaText::ConfigurationLoader.new(@configuration)
  end

  private
  def load(content)
    file = Tempfile.new("chupa-text")
    file.print(content)
    file.flush
    @loader.load(file.path)
    file
  end

  sub_test_case("decomposer") do
    def test_names
      load(<<-CONFIGURATION)
decomposer.names = ["tar", "zip"]
      CONFIGURATION
      assert_equal(["tar", "zip"], @configuration.decomposer.names)
    end

    def test_option
      load(<<-CONFIGURATION)
decomposer.tar = {
  :omit_size => true
}
      CONFIGURATION
      assert_equal({
                     "tar" => {
                       :omit_size => true,
                     },
                   },
                   @configuration.decomposer.options)
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
chupa-text-1.3.6 test/test-configuration-loader.rb
chupa-text-1.3.5 test/test-configuration-loader.rb
chupa-text-1.3.4 test/test-configuration-loader.rb
chupa-text-1.3.3 test/test-configuration-loader.rb
chupa-text-1.3.2 test/test-configuration-loader.rb
chupa-text-1.3.1 test/test-configuration-loader.rb
chupa-text-1.3.0 test/test-configuration-loader.rb
chupa-text-1.2.9 test/test-configuration-loader.rb
chupa-text-1.2.8 test/test-configuration-loader.rb
chupa-text-1.2.7 test/test-configuration-loader.rb
chupa-text-1.2.6 test/test-configuration-loader.rb
chupa-text-1.2.5 test/test-configuration-loader.rb
chupa-text-1.2.4 test/test-configuration-loader.rb
chupa-text-1.2.3 test/test-configuration-loader.rb
chupa-text-1.2.2 test/test-configuration-loader.rb
chupa-text-1.2.1 test/test-configuration-loader.rb
chupa-text-1.2.0 test/test-configuration-loader.rb
chupa-text-1.1.9 test/test-configuration-loader.rb
chupa-text-1.1.8 test/test-configuration-loader.rb
chupa-text-1.1.7 test/test-configuration-loader.rb