Sha256: 7f47cbf932460f8e343cd681969f5fa1e8e775832202a95873abc005bcb37d38

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

require 'test_helper'

class ConfigurationTest < Test::Unit::TestCase

  context "CloudCrowd Configuration" do
    
    setup { CloudCrowd.instance_variable_set("@actions", nil) }

    should "have read in config.yml" do
      assert CloudCrowd.config[:max_workers] == 10
      assert CloudCrowd.config[:storage] == 'filesystem'
    end
    
    should "allow config.yml to configure the implementation of AssetStore" do
      assert CloudCrowd::AssetStore.ancestors.include?(CloudCrowd::AssetStore::FilesystemStore)
    end
    
    should "have properly configured the ActiveRecord database" do
      assert ActiveRecord::Base.connection.active?
    end
    
    should "have loaded in the default set of actions" do
      assert CloudCrowd.actions['word_count']       == WordCount
      assert CloudCrowd.actions['process_pdfs']     == ProcessPdfs
      assert CloudCrowd.actions['graphics_magick']  == GraphicsMagick
    end
    
    should "not find custom actions unless 'actions_path' is set" do
      CloudCrowd.config[:actions_path] = nil
      assert CloudCrowd.actions.keys.length == 4
    end
    
    should "find custom actions when 'actions_path' is set" do
      CloudCrowd.config[:actions_path] = "#{CloudCrowd::ROOT}/test/config/actions/custom"
      assert CloudCrowd.actions['echo_action'] == EchoAction
      assert CloudCrowd.actions.keys.length == 5
    end
            
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cloud-crowd-0.3.2 test/unit/test_configuration.rb
cloud-crowd-0.3.1 test/unit/test_configuration.rb
cloud-crowd-0.3.0 test/unit/test_configuration.rb
cloud-crowd-0.2.9 test/unit/test_configuration.rb
cloud-crowd-0.2.8 test/unit/test_configuration.rb