Sha256: f9d1c1365696339824f38cf767e04a0245d710eb490f2afaa7b16ecbb7bafc2d
Contents?: true
Size: 1.33 KB
Versions: 5
Compression:
Stored size: 1.33 KB
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', 'check_for_duplicate_domains_filter')) describe 'filtering configuration data by normalizing domains' do before do @config = WhiskeyDisk::Config.new @filter = WhiskeyDisk::Config::CheckForDuplicateDomainsFilter.new(@config) end it 'should return the suuplied data if no domains appear more than once in a target' do @data = { 'repository' => 'x', 'domain' => [ { 'name' => 'bar@example.com', 'roles' => nil }, { 'name' => 'baz@domain.com', 'roles' => '' } ] } @filter.filter(@data).should == @data end it 'raises an exception if a domain appears more than once in a target' do @data = { 'repository' => 'x', 'domain' => [ { 'name' => 'bar@example.com', 'roles' => nil }, { 'name' => 'baz@domain.com', 'roles' => '' }, { 'name' => 'bar@example.com', 'roles' => [] } ] } lambda { @filter.filter(@data) }.should.raise end end
Version data entries
5 entries across 5 versions & 3 rubygems