Sha256: 850f20b90ead67d470c67bfa710f35d4e207960e73275a8d80a0b71c847fc5a4

Contents?: true

Size: 949 Bytes

Versions: 2

Compression:

Stored size: 949 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), 'test_helper'))

class ConfigurationTest < Test::Unit::TestCase
  context 'Global configuration options' do
    setup do
      module Extension; end
      
      @options = {
        'class_name' => 'CustomVersion',
        :extend => Extension,
        :as => :parent
      }
      
      VestalVersions.configure do |config|
        @options.each do |key, value|
          config.send("#{key}=", value)
        end
      end

      @configuration = VestalVersions::Configuration.options
    end

    should 'should be a hash' do
      assert_kind_of Hash, @configuration
    end

    should 'have symbol keys' do
      assert @configuration.keys.all?{|k| k.is_a?(Symbol) }
    end

    should 'store values identical to those given' do
      assert_equal @options.symbolize_keys, @configuration
    end

    teardown do
      VestalVersions::Configuration.options.clear
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
bitfluent-vestal_versions-1.1.0 test/configuration_test.rb
brianjlandau-vestal_versions-1.3.0 test/configuration_test.rb