Sha256: 0fcf67126c63e76ccf7d8dae5de731ba7a04ea9ff4ccc88b05b6dceab695ae8d

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'

# Fake a running instance of Capistrano
Capistrano::Configuration.instance = Capistrano::Configuration.new
require 'capistrano-provisioning/recipes'

describe "Recipes" do
  let(:config)      { Capistrano::Configuration.instance }
  
  context "namespace" do
    it "should create an :all task which loads all servers in that namespace" do
      pending("Currently failing due to inheritance confusion")

      config.load do
        namespace :test_namespace do
          cluster :test_cluster, 'cluster1.example.com'
        end
      end
      
      puts config.tasks.keys.inspect.gsub("<", '&lt;')
      config.namespaces.should include(:test_namespace)
      config.tasks.keys.should include(:test_namespace)
    end
  end

  context "global" do    
    it "should create a task to bootstrap the servers" do
      config.tasks.keys.should include(:run_bootstrap)
    end

    it "should create a task to install users on the servers" do
      config.tasks.keys.should include(:install_users)
    end
    
    it "should create a task to preview users that will be installed" do
      config.tasks.keys.should include(:install_users)      
    end
  end

  context "cluster definition" do
    it "should create a task to set the servers" do
      pending("Currently failing due to inheritance confusion")

      config.cluster :test_cluster
      config.tasks.keys.should include(:test_cluster)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-provisioning-0.0.8 spec/recipes_spec.rb
capistrano-provisioning-0.0.7 spec/recipes_spec.rb
capistrano-provisioning-0.0.6 spec/recipes_spec.rb