teststrap 1.2.4 → 1.2.5
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/bin/teststrap +1 -1
- data/generator_files/spec/default_spec.rb +1 -1
- data/lib/teststrap.rb +18 -18
- data/spec/teststrap_spec.rb +8 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa3f126204cfefd2023bcfcfb56123f46a418c3d
|
4
|
+
data.tar.gz: cc755162a6a8f4214d34256996fb2613f5e4cdfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23153b26e84196ccc892f20e9c19e91de6c060989a7dbf5ec3066fcc9f5db6b841c2ffcafc848b2f72b4ca98b26f683c7e6e58c9001af813588d590003df8757
|
7
|
+
data.tar.gz: 3bfdde812cd6b9c25aac2eeba4ebd22fd9e0fce00aa8efcf4b3149ea505945e183e544aea1d28c32dfd9a3340d3b436049e2f2128a5267433125ec75e19734e1
|
data/bin/teststrap
CHANGED
data/lib/teststrap.rb
CHANGED
@@ -9,28 +9,28 @@ module Teststrap
|
|
9
9
|
|
10
10
|
default_task :generate_tests
|
11
11
|
|
12
|
-
desc
|
12
|
+
desc 'generate_tests', 'generate test files'
|
13
13
|
def generate_tests
|
14
14
|
@cookbook_name = current_directory_name
|
15
|
-
puts
|
16
|
-
copy_file
|
17
|
-
copy_file
|
18
|
-
copy_file
|
19
|
-
copy_file
|
20
|
-
copy_file
|
21
|
-
copy_file
|
22
|
-
copy_file
|
23
|
-
copy_file
|
24
|
-
copy_file
|
25
|
-
template
|
26
|
-
template
|
27
|
-
template
|
15
|
+
puts 'generating testfiles::'
|
16
|
+
copy_file '.gitignore'
|
17
|
+
copy_file '.rubocop.yml'
|
18
|
+
copy_file 'Berksfile'
|
19
|
+
copy_file 'chefignore'
|
20
|
+
copy_file 'Gemfile'
|
21
|
+
copy_file 'LICENSE'
|
22
|
+
copy_file 'rubocop-disabled.yml'
|
23
|
+
copy_file 'Strainerfile'
|
24
|
+
copy_file 'Thorfile'
|
25
|
+
template 'spec/default_spec.rb'
|
26
|
+
template 'spec/chefspec_helper.rb'
|
27
|
+
template 'test/integration/default/serverspec/localhost/default_spec.rb',
|
28
28
|
"test/integration/#{@cookbook_name}/serverspec/localhost/default_spec.rb"
|
29
|
-
template
|
29
|
+
template 'test/integration/default/serverspec/spec_helper.rb',
|
30
30
|
"test/integration/#{@cookbook_name}/serverspec/spec_helper.rb"
|
31
|
-
template
|
32
|
-
template
|
33
|
-
template
|
31
|
+
template '.kitchen.yml'
|
32
|
+
template 'metadata.rb'
|
33
|
+
template 'README.md'
|
34
34
|
end
|
35
35
|
|
36
36
|
no_commands do
|
data/spec/teststrap_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require 'spec_helper'
|
|
3
3
|
describe Teststrap::Teststrap do
|
4
4
|
let(:teststrap) { described_class.new }
|
5
5
|
|
6
|
-
describe
|
7
|
-
FILES = [
|
6
|
+
describe 'generate_tests' do
|
7
|
+
FILES = ['Gemfile', 'Berksfile', 'Strainerfile', 'Thorfile', '.gitignore', 'LICENSE']
|
8
8
|
TEMPLATES = [
|
9
9
|
'README.md',
|
10
10
|
'metadata.rb',
|
@@ -21,7 +21,7 @@ describe Teststrap::Teststrap do
|
|
21
21
|
.and_return('test_cookbook')
|
22
22
|
end
|
23
23
|
|
24
|
-
it
|
24
|
+
it 'should generate files' do
|
25
25
|
|
26
26
|
FILES.each do |file|
|
27
27
|
teststrap.should_receive(:copy_file).with(file)
|
@@ -30,7 +30,7 @@ describe Teststrap::Teststrap do
|
|
30
30
|
teststrap.generate_tests
|
31
31
|
end
|
32
32
|
|
33
|
-
it
|
33
|
+
it 'should generate templates' do
|
34
34
|
|
35
35
|
TEMPLATES.each do |template|
|
36
36
|
teststrap.should_receive(:template).with(template)
|
@@ -40,15 +40,15 @@ describe Teststrap::Teststrap do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
-
describe
|
44
|
-
it
|
43
|
+
describe 'current_directory_name' do
|
44
|
+
it 'return current working directory name' do
|
45
45
|
Dir.stub('pwd').and_return('test/dir/test_cookbook')
|
46
46
|
expect(teststrap.current_directory_name).to eq 'test_cookbook'
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
describe
|
51
|
-
it
|
50
|
+
describe 'source_root' do
|
51
|
+
it 'return generator file path' do
|
52
52
|
expect(described_class.source_root)
|
53
53
|
.to include 'teststrap/generator_files'
|
54
54
|
end
|