batali 0.2.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +9 -0
- data/lib/batali/chefspec.rb +56 -0
- data/lib/batali/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd8679efebec3984ad2b5e8155ca72f3e2f17445
|
4
|
+
data.tar.gz: cc7ee3d73c0e7a9fb7c331005d61095ceecd9fbb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0051b4f1cfbd04e1eb9d7b709c52ead0e5b9ef16077d5a6308e7b6c7d7412e320c47b4efef5c833be210582e837d38382ce334e5cccc6f19cd6f41841e6a1b71
|
7
|
+
data.tar.gz: 94b780e0299a7e759912694a2a1aafd78b3bf4cd86d9d63616ca75018808dac39c4ca3a28cf6d8febd38047af7fd5fb70ed93d16a00aab9d2b221039cd94b589
|
data/CHANGELOG.md
CHANGED
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
|
data/lib/batali/version.rb
CHANGED
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
|
+
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-
|
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
|