chefspec 4.6.1 → 4.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f410d780fe92a5920a74f64838cf10de403ed2e8
4
- data.tar.gz: 5a3f7521450d65a824d1eca60b1ef5212508c509
3
+ metadata.gz: 9d6b31aada6aae7b0e9d80006a7f59b4928b4e18
4
+ data.tar.gz: ef5e7a024c06199069f4349264a69a113f096571
5
5
  SHA512:
6
- metadata.gz: fce0162abe4b2dc222b0f78fa45fe8739e314a0ca5835f461811244c4a8939c585423766a5103b9404b77f04d33a5ac78dd7c55f9f5acd7da37a9f9664ff5491
7
- data.tar.gz: 853c4db0453f16f55311c4fa1595aad07de144a0e2568bc39bbf0905232c68fa5196f46be7b31a25cd940e040cfa118a2653715a76ef1c0b2fcc098931a0f4b3
6
+ metadata.gz: caac16818a6152ae7cf12e4cc71a1649915be6d22fa175f486035009426e6c27d140e5a67833629976360765a99c4bbfbc1465c188ae7e8b4b66bf99066641d1
7
+ data.tar.gz: ad3ab1cf59daf6ea6f2aec22b7b417d96472d5625b927616d768e452aa30a12e8a05748e9871ea17b4544dba91c53290a4d0485dbbcf9af400035f06c54179b2
data/.gitignore CHANGED
@@ -11,5 +11,6 @@ Gemfile.lock
11
11
  gemfiles/*.lock
12
12
  .bundle
13
13
  bin
14
+ binstubs
14
15
  vendor
15
16
  .rspec
@@ -6,7 +6,6 @@ before_install:
6
6
  - gem install bundler
7
7
 
8
8
  rvm:
9
- - 2.0.0
10
9
  - 2.1
11
10
  - 2.2
12
11
 
@@ -32,15 +31,24 @@ env:
32
31
  - CHEF_VERSION=12.1.1
33
32
  - CHEF_VERSION=12.1.0
34
33
  - CHEF_VERSION=12.0.3
35
- - CHEF_VERSION=11.18.6
36
- - CHEF_VERSION=11.18.0
37
- - CHEF_VERSION=11.16.4
38
- - CHEF_VERSION=11.16.2
39
- - CHEF_VERSION=11.16.0
40
- - CHEF_VERSION=11.14.6
41
- - CHEF_VERSION=11.14.2
42
34
 
43
35
  matrix:
44
36
  fast_finish: true
45
37
  allow_failures:
46
38
  - env: CHEF_VERSION=master
39
+ include:
40
+ - env: CHEF_VERSION=11.18.6
41
+ rvm: 1.9.3
42
+ - env: CHEF_VERSION=11.18.0
43
+ rvm: 1.9.3
44
+ - env: CHEF_VERSION=11.16.4
45
+ rvm: 1.9.3
46
+ - env: CHEF_VERSION=11.16.2
47
+ rvm: 1.9.3
48
+ - env: CHEF_VERSION=11.16.0
49
+ rvm: 1.9.3
50
+ - env: CHEF_VERSION=11.14.6
51
+ rvm: 1.9.3
52
+ - env: CHEF_VERSION=11.14.2
53
+ rvm: 1.9.3
54
+
@@ -1,5 +1,11 @@
1
1
  # CHANGELOG for ChefSpec
2
2
 
3
+ ## 4.7.0 (May 13, 2016)
4
+
5
+ IMPROVEMENTS
6
+
7
+ - Support Chef Solo actually being local mode (per Chef RFC 31)
8
+
3
9
  ## 4.6.1 (March 29, 2016)
4
10
 
5
11
  BUG FIXES
data/README.md CHANGED
@@ -462,7 +462,7 @@ Create an environment:
462
462
 
463
463
  ```ruby
464
464
  ChefSpec::ServerRunner.new do |node, server|
465
- server.create_environment('my_environment', { description: '...' })
465
+ server.create_environment('my_environment', { default_attributes: { description: '...' } })
466
466
  end
467
467
  ```
468
468
 
@@ -571,6 +571,31 @@ describe 'example::default' do
571
571
  end
572
572
  ```
573
573
 
574
+ ### Library Helpers
575
+
576
+ Given a library helper with a `has_bacon?` method:
577
+
578
+ ```ruby
579
+ module Demo
580
+ module Helper
581
+
582
+ include Chef::Mixin::ShellOut
583
+
584
+ def has_bacon?
585
+ cmd = shell_out!('getent passwd bacon', {:returns => [0,2]})
586
+ cmd.stderr.empty? && (cmd.stdout =~ /^bacon/)
587
+ end
588
+ end
589
+ end
590
+ ```
591
+
592
+ Stub the output of the library helper. [Additional information](http://jtimberman.housepub.org/blog/2015/05/30/quick-tip-stubbing-library-helpers-in-chefspec/)
593
+ ```ruby
594
+ before do
595
+ allow_any_instance_of(Chef::Node).to receive(:has_bacon?).and_return(true)
596
+ end
597
+ ```
598
+
574
599
  ### Data Bag & Data Bag Item
575
600
  **NOTE** This is not required if you are using a ChefSpec server.
576
601
 
@@ -759,6 +784,18 @@ end
759
784
 
760
785
  Mocking Out Environments
761
786
  ------------------------
787
+ ### ServerRunner
788
+ ```ruby
789
+ ChefSpec::ServerRunner.new do |node, server|
790
+ # Create the environment
791
+ server.create_environment('staging', { default_attributes: { cookbook_attr: 'value' } })
792
+
793
+ # Assign the environment to the node
794
+ node.chef_environment = 'staging'
795
+ end
796
+ ```
797
+
798
+ ### SoloRunner
762
799
  If you want to mock out `node.chef_environment`, you'll need to use RSpec mocks/stubs twice:
763
800
 
764
801
  ```ruby
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
31
31
  s.add_dependency 'rspec', '~> 3.0'
32
32
 
33
33
  # Development Dependencies
34
- s.add_development_dependency 'rake', '< 11.0'
34
+ s.add_development_dependency 'rake', '< 12.0'
35
35
  s.add_development_dependency 'redcarpet', '~> 3.3'
36
36
  s.add_development_dependency 'yard', '~> 0.8'
37
37
 
@@ -27,6 +27,7 @@ module ChefSpec
27
27
  Chef::Config[:client_name] = 'chefspec'
28
28
  Chef::Config[:node_name] = 'chefspec'
29
29
  Chef::Config[:solo] = false
30
+ Chef::Config[:solo_legacy_mode] = false
30
31
 
31
32
  Chef::Config[:chef_server_url] = server.url
32
33
  Chef::Config[:http_retry_count] = 0
@@ -79,6 +79,7 @@ module ChefSpec
79
79
  Chef::Config[:role_path] = Array(@options[:role_path])
80
80
  Chef::Config[:force_logger] = true
81
81
  Chef::Config[:solo] = true
82
+ Chef::Config[:solo_legacy_mode] = true
82
83
  Chef::Config[:environment_path] = @options[:environment_path]
83
84
 
84
85
  yield node if block_given?
@@ -1,3 +1,3 @@
1
1
  module ChefSpec
2
- VERSION = '4.6.1'
2
+ VERSION = '4.7.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chefspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.1
4
+ version: 4.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Crump
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-29 00:00:00.000000000 Z
12
+ date: 2016-05-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chef
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "<"
61
61
  - !ruby/object:Gem::Version
62
- version: '11.0'
62
+ version: '12.0'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "<"
68
68
  - !ruby/object:Gem::Version
69
- version: '11.0'
69
+ version: '12.0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: redcarpet
72
72
  requirement: !ruby/object:Gem::Requirement