Skip to content

Commit 40a6b07

Browse files
committed
missing a windows_package_version
1 parent 2d6a53a commit 40a6b07

File tree

2 files changed

+25
-15
lines changed

2 files changed

+25
-15
lines changed

libraries/resource_git_client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class GitClient < Chef::Resource::LWRPBase
3232
attribute :windows_display_name, kind_of: String, default: nil
3333
attribute :windows_package_url, kind_of: String, default: nil
3434
attribute :windows_package_checksum, kind_of: String, default: nil
35+
attribute :windows_package_version, kind_of: String, default: nil
3536
end
3637
end
3738
end

spec/unit/recipes/windows_spec.rb

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
# require 'spec_helper'
1+
require 'spec_helper'
22

3-
# describe_recipe 'git::windows' do
4-
# let(:chef_run) { ChefSpec::SoloRunner.new(platform: 'windows', version: '2012').converge(described_recipe) }
5-
# it do
6-
# expect(chef_run).to install_windows_package(chef_run.node['git']['display_name'])
7-
# .with(source: chef_run.node['git']['url'])
8-
# .with(checksum: chef_run.node['git']['checksum'])
9-
# .with(installer_type: :inno)
10-
# end
3+
describe_recipe 'git::windows' do
4+
let(:chef_run) { ChefSpec::SoloRunner.new(
5+
platform: 'windows',
6+
version: '2012',
7+
step_into: 'git_client').converge(described_recipe) }
8+
9+
it {expect(chef_run).to install_git_client('default') }
10+
it do
11+
expect(chef_run).to install_windows_package(chef_run.node['git']['display_name'])
12+
.with(source: chef_run.node['git']['url'])
13+
.with(checksum: chef_run.node['git']['checksum'])
14+
.with(installer_type: :inno)
15+
end
1116

12-
# it { expect(chef_run).to add_windows_path('\Git\Cmd') }
13-
# it do
14-
# resource = chef_run.windows_path('\Git\Cmd')
15-
# expect(resource).to notify('ruby_block[Add Git Path]').to(:create).immediately
16-
# end
17-
# end
17+
it { expect(chef_run).to add_windows_path('C:\Program Files (x86)\Git\Cmd') }
18+
it do
19+
resource = chef_run.windows_path('C:\Program Files (x86)\Git\Cmd')
20+
expect(resource).to notify('ruby_block[Add Git Path]').to(:create).immediately
21+
end
22+
it do
23+
resource = chef_run.ruby_block('Add Git Path')
24+
expect(resource).to do_nothing
25+
end
26+
end

0 commit comments

Comments
 (0)