cheffish 2.0.1 → 2.0.2

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: 491dd7fe80ce36e6d903c07335aeb6c857c98121
4
- data.tar.gz: 3cea4e7dbe0a5f2e3b7ac1f56e03f87a41363b57
3
+ metadata.gz: 38fe61a70705c20dcf0065d1b862e15e93cd9fd3
4
+ data.tar.gz: e09465b9e3211a8f143ef18b049d1bb81c99d1b3
5
5
  SHA512:
6
- metadata.gz: 11fc063d1458e04d01bf387a5e55e32b416ad096d592755ef55dd1b177ffe1242c0de590dc9545455dad3f81c104cde67927fc0cf1cb66a4c05099188eee13a8
7
- data.tar.gz: 63edfe9a1aabef68a83141245fa4073e9cbcb133337fe4eaaeb9818c2c91e462930373d563dc873bd2bc3921c9268b79f11a4177ddcf545f53e5751c2993f83e
6
+ metadata.gz: 9953c8f46c25b5ea49f8af5f38b2a55d99b58024cafb2c04107e3a8efb1e8ce22e5c69bca8175523c6730cbec31c36d294df62a6568325b15b46f2a9c87a43ee
7
+ data.tar.gz: bc9997a091936c729fab952568c4f8700ea23b0c4a3928eca725c9a6cbd30a5f2b3aebdf8a339bdbcda3b2f6a9f9034e01c999f797d4e770b20433dc6b821616
@@ -30,7 +30,7 @@ class Chef
30
30
  # name can either be id, or data_bag/id
31
31
  property :id, String, default: lazy { name.split('/', 2)[-1] }
32
32
  property :data_bag, String, default: lazy {
33
- split = name.split('/', 2)[0]
33
+ split = name.split('/', 2)
34
34
  split.size >= 2 ? split[0] : nil
35
35
  }
36
36
 
@@ -14,7 +14,7 @@ module Cheffish
14
14
  raise "Can only create one directory per test" if @repository_dir
15
15
  @repository_dir = Dir.mktmpdir('chef_repo')
16
16
  Chef::Config.chef_repo_path = @repository_dir
17
- %w(client cookbook data_bag environment node role user).each do |object_name|
17
+ %w(client cookbook data_bag data_bag_item environment node role user).each do |object_name|
18
18
  Chef::Config.delete("#{object_name}_path".to_sym)
19
19
  end
20
20
  end
@@ -22,7 +22,7 @@ module Cheffish
22
22
  after :each do
23
23
  if @repository_dir
24
24
  begin
25
- %w(client cookbook data_bag environment node role user).each do |object_name|
25
+ %w(client cookbook data_bag data_bag_item environment node role user).each do |object_name|
26
26
  Chef::Config.delete("#{object_name}_path".to_sym)
27
27
  end
28
28
  Chef::Config.delete(:chef_repo_path)
@@ -1,3 +1,3 @@
1
1
  module Cheffish
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
@@ -0,0 +1,26 @@
1
+ require 'support/spec_support'
2
+ require 'cheffish/rspec/chef_run_support'
3
+
4
+ describe Chef::Resource::ChefDataBagItem do
5
+ extend Cheffish::RSpec::ChefRunSupport
6
+
7
+ when_the_chef_12_server 'foo' do
8
+ organization 'foo'
9
+
10
+ before :each do
11
+ Chef::Config.chef_server_url = URI.join(Chef::Config.chef_server_url, '/organizations/foo').to_s
12
+ end
13
+
14
+ context 'when data bag "bag" exists' do
15
+ with_converge { chef_data_bag 'bag' }
16
+
17
+ it 'runs a recipe that creates a chef_data_bag_item "bag/item"' do
18
+ expect_recipe {
19
+ chef_data_bag_item 'bag/item'
20
+ }.to have_updated 'chef_data_bag_item[bag/item]', :create
21
+ # expect(get('data_bags/bag')['name']).to eq('bag')
22
+ # expect(get('data_bags/bag/item')['id']).to eq('item')
23
+ end
24
+ end
25
+ end
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheffish
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-29 00:00:00.000000000 Z
11
+ date: 2016-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef-zero
@@ -153,6 +153,7 @@ files:
153
153
  - spec/integration/chef_acl_spec.rb
154
154
  - spec/integration/chef_client_spec.rb
155
155
  - spec/integration/chef_container_spec.rb
156
+ - spec/integration/chef_data_bag_item_spec.rb
156
157
  - spec/integration/chef_group_spec.rb
157
158
  - spec/integration/chef_mirror_spec.rb
158
159
  - spec/integration/chef_node_spec.rb
@@ -185,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
186
  version: '0'
186
187
  requirements: []
187
188
  rubyforge_project:
188
- rubygems_version: 2.2.5
189
+ rubygems_version: 2.4.5.1
189
190
  signing_key:
190
191
  specification_version: 4
191
192
  summary: A library to manipulate Chef in Chef.