Merge pull request #260 from daenney/zomg-ze-chars
[puppet-modules/puppetlabs-apt.git] / spec / defines / pin_spec.rb
index 5d3d312ed69a65208f4d9c1060dc3881a19b4a18..6438e8cbee46a7ce1c244fa8f3346b42287e2dfa 100644 (file)
@@ -61,7 +61,7 @@ describe 'apt::pin', :type => :define do
         :priority => '1',
         :origin   => 'ftp.de.debian.org'
       },
-      :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: origin \"ftp.de.debian.org\"\nPin-Priority: 1\n"
+      :content => "# my_pin\nExplanation: : my_pin\nPackage: *\nPin: origin ftp.de.debian.org\nPin-Priority: 1\n"
     },
     {
       :params => {
@@ -105,4 +105,16 @@ describe 'apt::pin', :type => :define do
       }
     end
   end
+
+  describe 'resource title with invalid chars' do
+    context 'spaces' do
+      let(:title) { 'oh my god this is not valid' }
+      it { should contain_file('oh_my_god_this_is_not_valid.pref') }
+    end
+
+    context '#$&*$' do
+      let(:title) { 'so && many $* invalid @! things' }
+      it { should contain_file('so____many____invalid____things.pref') }
+    end
+  end
 end