chef-vault-testfixtures 3.0.0 → 3.0.1

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: 406d52b7d304af1e894b61f550890d93a1170180
4
- data.tar.gz: 63c62b375e91bba72f41e539fef27a84430755ff
3
+ metadata.gz: 5b67a15bc44d54b66d412102daff5375dce2631b
4
+ data.tar.gz: 16857caafe5649a560f9efa01a359112133f41ea
5
5
  SHA512:
6
- metadata.gz: b146d3474b7fdf38d82342fb5e564510ae44c610768d3f6486bed16bebe3711313b4b9ea9ed83c7a57ca204936561c743cc68e4a73825d29b114115c6075d32c
7
- data.tar.gz: f673a07aa486d33af55b2517a105b80795fc9687060a8c93a3616a86c7b34786cd0200bb5cdd7f08f271572f4c619fb54452252608304d47af86b7cc11d9ab35
6
+ metadata.gz: e15b9677e03bdbee6681eb40ed372924d5691d51960f4a8c6f7143e3c2a0891899e6ce267f7e6ca9b9acfc30dd95d712f00b2921c721e1b520437cd327b33bc6
7
+ data.tar.gz: 96aa23c40db52eff0a6ecb3d74c6ced80c3f047ed7e8cf2c902fc72ced2c368b1362d604d402feb1ab3870dc55b27bd670e580ae751d817bf2b0425fd32f8eb7
@@ -1,9 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: chef-vault-testfixtures 0.5.2.20160205150644 ruby lib
2
+ $:.unshift(File.dirname(__FILE__) + "/lib")
3
+ require "chef-vault/test_fixtures_version"
3
4
 
4
5
  Gem::Specification.new do |s|
5
6
  s.name = "chef-vault-testfixtures"
6
- s.version = "3.0.0"
7
+ s.version = ChefVault::TestFixtures::VERSION
7
8
 
8
9
  s.require_paths = ["lib"]
9
10
  s.authors = ["Thom May"]
@@ -6,13 +6,12 @@ require "rspec"
6
6
  require "rspec/core/shared_context"
7
7
  require "chef-vault"
8
8
 
9
+ require "chef-vault/test_fixtures_version"
10
+
9
11
  # chef-vault helps manage encrypted data bags using a node's public key
10
12
  class ChefVault
11
13
  # dynamic RSpec contexts for cookbooks that use chef-vault
12
14
  class TestFixtures
13
- # the version of the gem
14
- VERSION = "0.6.0"
15
-
16
15
  # dynamically creates a memoized RSpec shared context
17
16
  # that when included into an example group will stub
18
17
  # ChefVault::Item for each of the defined vaults. The
@@ -42,9 +41,13 @@ class ChefVault
42
41
  # @api private
43
42
  def find_vaults(stub_encrypted_data)
44
43
  dbdir = Pathname.new("test") + "integration" + "data_bags"
45
- dbdir.each_child do |vault|
46
- next unless vault.directory?
47
- stub_vault(stub_encrypted_data, vault)
44
+ smokedir = Pathname.new("test") + "smoke" + "default" + "data_bags"
45
+ [ dbdir, smokedir ].each do |dir|
46
+ next unless dir.directory?
47
+ dir.each_child do |vault|
48
+ next unless vault.directory?
49
+ stub_vault(stub_encrypted_data, vault)
50
+ end
48
51
  end
49
52
  end
50
53
 
@@ -0,0 +1,7 @@
1
+ class ChefVault
2
+ # dynamic RSpec contexts for cookbooks that use chef-vault
3
+ class TestFixtures
4
+ # the version of the gem
5
+ VERSION = "3.0.1"
6
+ end
7
+ end
@@ -44,6 +44,11 @@ RSpec.describe ChefVault::TestFixtures do
44
44
  expect(item1["baz"]).to eq(item2["baz"])
45
45
  end
46
46
 
47
+ it "should check both smoke and integration for a vault" do
48
+ item = ChefVault::Item.load("canteloupe", "foo")
49
+ item["cat"] == "cat"
50
+ end
51
+
47
52
  it "should allow and ignore an attempt to change a vault" do
48
53
  item = ChefVault::Item.load("bar", "foo")
49
54
  item["foo"] = "foo"
@@ -14,7 +14,7 @@ RSpec.describe "test1::default" do
14
14
  include ChefVault::TestFixtures.rspec_shared_context(false)
15
15
 
16
16
  let(:chef_run) do
17
- ChefSpec::ServerRunner.new(platform: 'ubuntu', version: '16.04') do |_, server|
17
+ ChefSpec::ServerRunner.new(platform: "ubuntu", version: "16.04") do |_, server|
18
18
  server.create_data_bag(
19
19
  "baz", "wibble" => parse_data_bag("baz/wibble.json")
20
20
  )
@@ -0,0 +1,3 @@
1
+ {
2
+ "cat": "cat"
3
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-vault-testfixtures
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom May
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-27 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -252,6 +252,7 @@ files:
252
252
  - TODO.md
253
253
  - chef-vault-testfixtures.gemspec
254
254
  - lib/chef-vault/test_fixtures.rb
255
+ - lib/chef-vault/test_fixtures_version.rb
255
256
  - spec/lib/chef-vault/test_fixtures_spec.rb
256
257
  - spec/recipes/test1_default_spec.rb
257
258
  - spec/spec_helper.rb
@@ -261,6 +262,7 @@ files:
261
262
  - test/integration/data_bags/bar/gzonk.json
262
263
  - test/integration/data_bags/baz/wibble.json
263
264
  - test/integration/data_bags/foo/bar.json
265
+ - test/smoke/default/data_bags/canteloupe/foo.json
264
266
  homepage: https://github.com/chef/chef-vault-testfixtures
265
267
  licenses:
266
268
  - apache2