Skip to content

Commit

Permalink
fixes #324 copying font files before installing the font
Browse files Browse the repository at this point in the history
  • Loading branch information
mwrock committed Jan 7, 2016
1 parent 25eaecf commit 97ed27b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .kitchen.yml
Expand Up @@ -53,3 +53,8 @@ suites:
run_list:
- recipe[windows::default]
- recipe[minimal::http_acl]

- name: font
run_list:
- recipe[windows::default]
- recipe[minimal::font]
9 changes: 5 additions & 4 deletions providers/font.rb
Expand Up @@ -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
Expand Down
12 changes: 0 additions & 12 deletions test/cookbooks/minimal/recipes/default.rb

This file was deleted.

1 change: 1 addition & 0 deletions test/cookbooks/minimal/recipes/font.rb
@@ -0,0 +1 @@
windows_font 'CodeNewRoman.otf'
10 changes: 10 additions & 0 deletions 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
}
}
}

0 comments on commit 97ed27b

Please sign in to comment.