Sha256: 24a038d184b54d1eade0411cd7c604e281f21c46da5467975f41e4585f9cfb89

Contents?: true

Size: 946 Bytes

Versions: 5

Compression:

Stored size: 946 Bytes

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper.rb'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'lib', 'whiskey_disk', 'config'))
require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..', '..', 'lib', 'whiskey_disk', 'config', 'filters', 'add_project_name_filter'))

describe 'filtering configuration data by adding the project name' do
  before do
    @config = WhiskeyDisk::Config.new
    @filter = WhiskeyDisk::Config::AddProjectNameFilter.new(@config)
    ENV['to'] = 'project:environment'
  end
  
  it 'adds an environment value when none is present' do
    @filter.filter('foo' => 'bar').should == { 'project' => 'project', 'foo' => 'bar' }
  end
  
  it 'overwrites an environment value when one is present' do
    @filter.filter('project' => 'baz', 'foo' => 'bar').should == { 'project' => 'project', 'foo' => 'bar' }      
  end  
end

Version data entries

5 entries across 5 versions & 3 rubygems

Version Path
ol-whisk_deploy-0.6.25 spec/whiskey_disk/config/filters/add_project_name_filter_spec.rb
ol-whisk_deploy-0.6.26 spec/whiskey_disk/config/filters/add_project_name_filter_spec.rb
whisk_deploy-0.6.26 spec/whiskey_disk/config/filters/add_project_name_filter_spec.rb
whiskey_disk-0.6.24 spec/whiskey_disk/config/filters/add_project_name_filter_spec.rb
whiskey_disk-0.6.23 spec/whiskey_disk/config/filters/add_project_name_filter_spec.rb