puppetlabs_spec_helper 0.3.0 → 0.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,13 @@
1
+ 2012-12-14 Puppet Labs <info@puppetlabs.com> - 0.4.0-rc1
2
+ * Rake should fail if git can't clone repository
3
+ * Add readme for fixtures
4
+ * Fix Mocha deprecations
5
+ * add opts logic to rake spec_clean
6
+ * add backwards-compatible support for arbitrary git refs in .fixtures.yml
7
+ * Only remove the site.pp if it is empty
8
+ * (#15464) Make contributing easy via bundle Gemfile
9
+ * (#15464) Add gemspec from 0.3.0 published gem
10
+
1
11
  2012-08-14 Puppet Labs <info@puppetlabs.com> - 0.3.0
2
12
  * Add PuppetInternals compatibility module for
3
13
  scope, node, compiler, and functions
@@ -7,9 +7,9 @@ ARGV.clear
7
7
  ENV['MOCHA_OPTIONS']='skip_integration'
8
8
 
9
9
  require 'puppet'
10
- require 'mocha'
11
10
  gem 'rspec', '>=2.0.0'
12
11
  require 'rspec/expectations'
12
+ require 'mocha/api'
13
13
 
14
14
  require 'pathname'
15
15
  require 'tmpdir'
@@ -34,10 +34,17 @@ def fixtures(category)
34
34
 
35
35
  result = {}
36
36
  if fixtures.include? category
37
- fixtures[category].each do |fixture, source|
38
- target = "spec/fixtures/modules/#{fixture}"
39
- real_source = eval('"'+source+'"')
40
- result[real_source] = target
37
+ fixtures[category].each do |fixture, opts|
38
+ if opts.instance_of?(String)
39
+ source = opts
40
+ target = "spec/fixtures/modules/#{fixture}"
41
+ real_source = eval('"'+source+'"')
42
+ result[real_source] = target
43
+ elsif opts.instance_of?(Hash)
44
+ target = "spec/fixtures/modules/#{fixture}"
45
+ real_source = eval('"'+opts["repo"]+'"')
46
+ result[real_source] = { "target" => target, "ref" => opts["ref"] }
47
+ end
41
48
  end
42
49
  end
43
50
  return result
@@ -45,8 +52,19 @@ end
45
52
 
46
53
  desc "Create the fixtures directory"
47
54
  task :spec_prep do
48
- fixtures("repositories").each do |repo, target|
49
- File::exists?(target) || system("git clone #{repo} #{target}")
55
+ fixtures("repositories").each do |remote, opts|
56
+ if opts.instance_of?(String)
57
+ target = opts
58
+ ref = "refs/remotes/origin/master"
59
+ elsif opts.instance_of?(Hash)
60
+ target = opts["target"]
61
+ ref = opts["ref"]
62
+ end
63
+
64
+ unless File::exists?(target) || system("git clone #{remote} #{target}")
65
+ fail "Failed to clone #{remote} into #{target}"
66
+ end
67
+ system("cd #{target}; git reset --hard #{ref}") if ref
50
68
  end
51
69
 
52
70
  FileUtils::mkdir_p("spec/fixtures/modules")
@@ -60,15 +78,22 @@ end
60
78
 
61
79
  desc "Clean up the fixtures directory"
62
80
  task :spec_clean do
63
- fixtures("repositories").each do |repo, target|
81
+ fixtures("repositories").each do |remote, opts|
82
+ if opts.instance_of?(String)
83
+ target = opts
84
+ elsif opts.instance_of?(Hash)
85
+ target = opts["target"]
86
+ end
64
87
  FileUtils::rm_rf(target)
65
88
  end
66
89
 
67
90
  fixtures("symlinks").each do |source, target|
68
91
  FileUtils::rm(target)
69
92
  end
70
-
71
- FileUtils::rm("spec/fixtures/manifests/site.pp")
93
+ site = "spec/fixtures/manifests/site.pp"
94
+ if File::exists?(site) and ! File.size?(site)
95
+ FileUtils::rm("spec/fixtures/manifests/site.pp")
96
+ end
72
97
  end
73
98
 
74
99
  desc "Run spec tests in a clean fixtures directory"
metadata CHANGED
@@ -1,88 +1,96 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: puppetlabs_spec_helper
3
- version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ hash: -228997126
5
+ prerelease: 6
6
+ segments:
7
+ - 0
8
+ - 4
9
+ - 0
10
+ - rc
11
+ - 1
12
+ version: 0.4.0.rc1
6
13
  platform: ruby
7
- authors:
14
+ authors:
8
15
  - Puppet Labs
9
16
  autorequire:
10
17
  bindir: bin
11
18
  cert_chain: []
12
- date: 2012-08-15 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
19
+
20
+ date: 2012-12-14 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
15
23
  name: rake
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: '0'
22
- type: :runtime
23
24
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
30
- - !ruby/object:Gem::Dependency
31
- name: rspec
32
- requirement: !ruby/object:Gem::Requirement
25
+ requirement: &id001 !ruby/object:Gem::Requirement
33
26
  none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: 2.9.0
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ hash: 3
31
+ segments:
32
+ - 0
33
+ version: "0"
38
34
  type: :runtime
35
+ version_requirements: *id001
36
+ - !ruby/object:Gem::Dependency
37
+ name: rspec
39
38
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
39
+ requirement: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 43
45
+ segments:
46
+ - 2
47
+ - 9
48
+ - 0
45
49
  version: 2.9.0
46
- - !ruby/object:Gem::Dependency
47
- name: mocha
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: 0.10.5
54
50
  type: :runtime
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
53
+ name: mocha
55
54
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
55
+ requirement: &id003 !ruby/object:Gem::Requirement
57
56
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 61
61
+ segments:
62
+ - 0
63
+ - 10
64
+ - 5
61
65
  version: 0.10.5
62
- - !ruby/object:Gem::Dependency
63
- name: rspec-puppet
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: 0.1.1
70
66
  type: :runtime
67
+ version_requirements: *id003
68
+ - !ruby/object:Gem::Dependency
69
+ name: rspec-puppet
71
70
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
71
+ requirement: &id004 !ruby/object:Gem::Requirement
73
72
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ hash: 25
77
+ segments:
78
+ - 0
79
+ - 1
80
+ - 1
77
81
  version: 0.1.1
78
- description: Contains rake tasks and a standard spec_helper for running spec tests
79
- on puppet modules
80
- email:
82
+ type: :runtime
83
+ version_requirements: *id004
84
+ description: Contains rake tasks and a standard spec_helper for running spec tests on puppet modules
85
+ email:
81
86
  - puppet-dev@puppetlabs.com
82
87
  executables: []
88
+
83
89
  extensions: []
90
+
84
91
  extra_rdoc_files: []
85
- files:
92
+
93
+ files:
86
94
  - lib/puppetlabs_spec_helper/module_spec_helper.rb
87
95
  - lib/puppetlabs_spec_helper/puppet_spec_helper.rb
88
96
  - lib/puppetlabs_spec_helper/puppetlabs_spec/files.rb
@@ -95,26 +103,38 @@ files:
95
103
  - CHANGELOG
96
104
  homepage: http://github.com/puppetlabs/puppetlabs_spec_helper
97
105
  licenses: []
106
+
98
107
  post_install_message:
99
108
  rdoc_options: []
100
- require_paths:
109
+
110
+ require_paths:
101
111
  - lib
102
- required_ruby_version: !ruby/object:Gem::Requirement
112
+ required_ruby_version: !ruby/object:Gem::Requirement
103
113
  none: false
104
- requirements:
105
- - - ! '>='
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- required_rubygems_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ hash: 3
118
+ segments:
119
+ - 0
120
+ version: "0"
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
122
  none: false
110
- requirements:
111
- - - ! '>='
112
- - !ruby/object:Gem::Version
113
- version: '0'
123
+ requirements:
124
+ - - ">"
125
+ - !ruby/object:Gem::Version
126
+ hash: 25
127
+ segments:
128
+ - 1
129
+ - 3
130
+ - 1
131
+ version: 1.3.1
114
132
  requirements: []
133
+
115
134
  rubyforge_project:
116
135
  rubygems_version: 1.8.24
117
136
  signing_key:
118
137
  specification_version: 3
119
138
  summary: Standard tasks and configuration for module spec tests
120
139
  test_files: []
140
+