Sha256: c21f0e6e06b7f544bfc4c685699ec0bcd7576f7808b06057d799c7bb6958e866

Contents?: true

Size: 957 Bytes

Versions: 3

Compression:

Stored size: 957 Bytes

Contents

require_relative '../lib/depengine'

describe 'a recipe' do

  context 'when running' do
    it 'does create a Deployment.deliver block' do

      Deployment::Methods.set :env, 'test'
      Deployment::Methods.set :version, '0.42'
      Deployment::Methods.set :deploy_home, '.'
      Deployment::Methods.set :module_name, 'module_name'

      expect { Deployment.deliver { puts '.' } }.to raise_error(SystemExit)

    end

    it 'sets some values with the set method' do
      Deployment::Methods.set :spec_key, :this_is_set
      expect($recipe_config[:spec_key]).to be :this_is_set
    end

  end

  context 'before running' do
    it 'needs to set a module name' do
      Deployment::Methods.set :env, 'test'
      Deployment::Methods.set :version, '0.42'
      Deployment::Methods.set :deploy_home, '.'

      expect { Deployment.deliver { puts '.' } }.to raise_error(ArgumentError)
    end
  end

  before :each do
    $recipe_config = {}
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
depengine-3.0.23 spec/recipe_spec.rb
depengine-3.0.22 spec/recipe_spec.rb
depengine-3.0.21 spec/recipe_spec.rb