batali 0.2.4 → 0.2.6

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: 3d07b92c629d84ed1ca5fe885ee8eae8b7426c30
4
- data.tar.gz: a17f9cbb2e9e42f0f8881ac196a5320176a93376
3
+ metadata.gz: dd8679efebec3984ad2b5e8155ca72f3e2f17445
4
+ data.tar.gz: cc7ee3d73c0e7a9fb7c331005d61095ceecd9fbb
5
5
  SHA512:
6
- metadata.gz: 4209014fa64523d06c2bdb05451a199da4508fffccf33a92af7f5d1b10cd8b4db7c1aefb2df1f32ef7572bfb5f9963b8bd6fe4273490909e91fe6486caffd723
7
- data.tar.gz: f05d9c4cdca2a6e1e7d3770ed24894d8c2fb04e8fa4e0736bbc8a50b252435488fa146b85c58563c46d0690a2d71835fd9fd91dd6864af3ee25aa813cb9ffb60
6
+ metadata.gz: 0051b4f1cfbd04e1eb9d7b709c52ead0e5b9ef16077d5a6308e7b6c7d7412e320c47b4efef5c833be210582e837d38382ce334e5cccc6f19cd6f41841e6a1b71
7
+ data.tar.gz: 94b780e0299a7e759912694a2a1aafd78b3bf4cd86d9d63616ca75018808dac39c4ca3a28cf6d8febd38047af7fd5fb70ed93d16a00aab9d2b221039cd94b589
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # v0.2.6
2
+ * Add support for ChefSpec
3
+
1
4
  # v0.2.4
2
5
  * Fix caching support
3
6
 
data/README.md CHANGED
@@ -208,6 +208,15 @@ Batali can be used with [Test Kitchen](https://github.com/test-kitchen/test-kitc
208
208
 
209
209
  * https://github.com/hw-labs/batali-tk
210
210
 
211
+ ## ChefSpec
212
+
213
+ Batali can be used with [ChefSpec](https://github.com/sethvargo/chefspec). Add the following
214
+ line to your `spec_helper.rb` file:
215
+
216
+ ```ruby
217
+ require 'batali/chefspec'
218
+ ```
219
+
211
220
  # Info
212
221
 
213
222
  * Repository: https://github.com/hw-labs/batali
@@ -0,0 +1,56 @@
1
+ require 'batali'
2
+ require 'stringio'
3
+ require 'fileutils'
4
+ require 'tmpdir'
5
+
6
+ module ChefSpec
7
+ class Batali
8
+
9
+ class << self
10
+ extend Forwardable
11
+ def_delegators :instance, :setup!, :teardown!
12
+ end
13
+
14
+ include Singleton
15
+
16
+ def initialize
17
+ @vendor_path = Dir.mktmpdir
18
+ end
19
+
20
+ def setup!
21
+ output = ''
22
+ begin
23
+ ::Batali::Command::Update.new(
24
+ Smash.new(
25
+ :file => File.join(Dir.pwd, 'Batali'),
26
+ :path => @vendor_path,
27
+ :ui => Bogo::Ui.new(
28
+ :app_name => 'Batali',
29
+ :output_to => StringIO.new(output)
30
+ )
31
+ ),
32
+ []
33
+ ).execute!
34
+ RSpec.configure do |config|
35
+ config.cookbook_path = @vendor_path
36
+ end
37
+ rescue => e
38
+ $stderr.puts "Batali failure - #{e.class}: #{e.message}"
39
+ $stderr.puts output
40
+ raise
41
+ end
42
+ end
43
+
44
+ def teardown!
45
+ if(File.directory?(@vendor_path))
46
+ FileUtils.rm_rf(@vendor_path)
47
+ end
48
+ end
49
+
50
+ end
51
+ end
52
+
53
+ RSpec.configure do |config|
54
+ config.before(:suite){ ChefSpec::Batali.setup! }
55
+ config.after(:suite){ ChefSpec::Batali.teardown! }
56
+ end
@@ -1,4 +1,4 @@
1
1
  module Batali
2
2
  # Current version
3
- VERSION = Gem::Version.new('0.2.4')
3
+ VERSION = Gem::Version.new('0.2.6')
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: batali
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Roberts
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-06 00:00:00.000000000 Z
11
+ date: 2015-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: attribute_struct
@@ -179,6 +179,7 @@ files:
179
179
  - bin/batali
180
180
  - lib/batali.rb
181
181
  - lib/batali/b_file.rb
182
+ - lib/batali/chefspec.rb
182
183
  - lib/batali/command.rb
183
184
  - lib/batali/command/configure.rb
184
185
  - lib/batali/command/install.rb