diff --git a/.kitchen.yml b/.kitchen.yml index 9e10d831..6e1857fc 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -53,3 +53,8 @@ suites: run_list: - recipe[windows::default] - recipe[minimal::http_acl] + + - name: font + run_list: + - recipe[windows::default] + - recipe[minimal::font] diff --git a/providers/font.rb b/providers/font.rb index d6b1af6a..069f628a 100644 --- a/providers/font.rb +++ b/providers/font.rb @@ -37,11 +37,12 @@ def font_exists? end def get_cookbook_font - cookbook_file @new_resource.file do - action :create + font_file = @new_resource.file + cookbook_file font_file do + action :nothing cookbook cookbook_name.to_s unless cookbook_name.nil? - path win_friendly_path(::File.join(ENV['TEMP'], @new_resource.file)) - end + path win_friendly_path(::File.join(ENV['TEMP'], font_file)) + end.run_action(:create) end def del_cookbook_font diff --git a/test/cookbooks/minimal/recipes/default.rb b/test/cookbooks/minimal/recipes/default.rb deleted file mode 100644 index a2724984..00000000 --- a/test/cookbooks/minimal/recipes/default.rb +++ /dev/null @@ -1,12 +0,0 @@ -# This recipe makes sure that updating that path does not trash it -# Failing to converge this recipe means that windows_path trashed -# - -windows_package 'Mozilla Firefox 5.0 (x86 en-US)' do - source 'http://archive.mozilla.org/pub/mozilla.org/mozilla.org/firefox/releases/5.0/win32/en-US/Firefox%20Setup%205.0.exe' - options '-ms' - installer_type :custom - action :install -end - -windows_font 'CodeNewRoman.otf' diff --git a/test/cookbooks/minimal/recipes/font.rb b/test/cookbooks/minimal/recipes/font.rb new file mode 100644 index 00000000..393d85d1 --- /dev/null +++ b/test/cookbooks/minimal/recipes/font.rb @@ -0,0 +1 @@ +windows_font 'CodeNewRoman.otf' diff --git a/test/integration/font/pester/minimal.font.Tests.ps1 b/test/integration/font/pester/minimal.font.Tests.ps1 new file mode 100644 index 00000000..6c3123ef --- /dev/null +++ b/test/integration/font/pester/minimal.font.Tests.ps1 @@ -0,0 +1,10 @@ +$global:progressPreference = 'SilentlyContinue' + +describe 'minimal::font' { + context 'windows_font' { + + it "installs CodeNewRoman" { + "c:/windows/fonts/CodeNewRoman.otf" | Should Exist + } + } +}