File tree Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Expand file tree Collapse file tree 2 files changed +25
-15
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ class GitClient < Chef::Resource::LWRPBase
32
32
attribute :windows_display_name , kind_of : String , default : nil
33
33
attribute :windows_package_url , kind_of : String , default : nil
34
34
attribute :windows_package_checksum , kind_of : String , default : nil
35
+ attribute :windows_package_version , kind_of : String , default : nil
35
36
end
36
37
end
37
38
end
Original file line number Diff line number Diff line change 1
- # require 'spec_helper'
1
+ require 'spec_helper'
2
2
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
11
16
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
You can’t perform that action at this time.
0 commit comments