rspec-puppet-facts 0.3.2 → 0.3.3

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.
@@ -113,4 +113,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
113
113
  host.vm.provision "shell", path: "get_facts.sh"
114
114
  host.vm.provision "shell", inline: "/sbin/shutdown -h now"
115
115
  end
116
+ config.vm.define "opensuse-12-x86_64" do |host|
117
+ host.vm.hostname = "foo.example.com"
118
+ host.vm.box = "alexeym/opensuse-12.3"
119
+ host.vm.provision "shell", inline: "zypper install -y rubygems ruby-devel make gcc"
120
+ host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
121
+ host.vm.provision "shell", path: "get_facts.sh"
122
+ host.vm.provision "shell", inline: "/sbin/shutdown -h now"
123
+ end
124
+ config.vm.define "opensuse-13-x86_64" do |host|
125
+ host.vm.hostname = "foo.example.com"
126
+ host.vm.box = "chef/opensuse-13.1"
127
+ host.vm.provision "file", source: "Gemfile", destination: "Gemfile"
128
+ host.vm.provision "shell", path: "get_facts.sh"
129
+ host.vm.provision "shell", inline: "/sbin/shutdown -h now"
130
+ end
116
131
  end
@@ -1,7 +1,7 @@
1
1
  #!/bin/bash
2
2
 
3
- # Fix for squeeze, el7 and arch
4
- export PATH=$PATH:/var/lib/gems/1.8/bin/:/usr/local/bin:/root/.gem/ruby/2.1.0/bin
3
+ # Fix for squeeze, el7, arch, opensuse12 and opensuse13
4
+ export PATH=$PATH:/var/lib/gems/1.8/bin/:/usr/local/bin:/root/.gem/ruby/2.1.0/bin:/usr/lib64/ruby/gems/1.9.1/gems/bundler-1.7.11/bin:/usr/lib64/ruby/gems/2.0.0/gems/bundler-1.7.11/bin
5
5
 
6
6
  # Install latest version of facter
7
7
  gem install bundler --no-ri --no-rdoc
@@ -1,5 +1,5 @@
1
1
  module RspecPuppetFacts
2
2
  module Version
3
- STRING = '0.3.2'
3
+ STRING = '0.3.3'
4
4
  end
5
5
  end
@@ -16,9 +16,11 @@ Gem::Specification.new do |s|
16
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
18
 
19
+ s.add_development_dependency 'mime-types', '~> 1.0' # 2.x dropped Ruby 1.8 support
19
20
  s.add_development_dependency 'coveralls', '~> 0.7'
20
21
  s.add_development_dependency 'rake', '~> 10.4'
21
22
  s.add_development_dependency 'rspec', '~> 3.1'
23
+ s.add_development_dependency 'mocha'
22
24
  s.add_runtime_dependency 'json', '~> 1.8'
23
- s.add_runtime_dependency 'facter', '~> 1.6'
25
+ s.add_runtime_dependency 'facter'
24
26
  end
@@ -11,28 +11,28 @@ describe 'RspecPuppetFacts' do
11
11
  it { expect { subject }.to raise_error(StandardError, /Can't find metadata.json/) }
12
12
  end
13
13
 
14
- # context 'With a metadata.json' do
15
- # fixture = File.read('spec/fixtures/metadata.json')
16
- # File.stubs('file?')
17
- # File.stubs('read')
18
- # File.expects('file?').with('metadata.json').returns true
19
- # File.expects('read').with('metadata.json').returns fixture
20
- # it 'should return a hash' do
21
- # expect( on_supported_os().class ).to eq Hash
22
- # end
23
- # it 'should have 5 elements' do
24
- # expect(subject.size).to eq 5
25
- # end
26
- # it 'should return supported OS' do
27
- # expect(subject.keys.sort).to eq [
28
- # 'debian-6-x86_64',
29
- # 'debian-7-x86_64',
30
- # 'redhat-5-x86_64',
31
- # 'redhat-6-x86_64',
32
- # 'redhat-7-x86_64',
33
- # ]
34
- # end
35
- # end
14
+ context 'With a metadata.json' do
15
+ before :all do
16
+ fixture = File.read('spec/fixtures/metadata.json')
17
+ RspecPuppetFacts.expects(:get_metadata).returns JSON.parse(fixture)
18
+ end
19
+
20
+ it 'should return a hash' do
21
+ expect( on_supported_os().class ).to eq Hash
22
+ end
23
+ it 'should have 5 elements' do
24
+ expect(subject.size).to eq 5
25
+ end
26
+ it 'should return supported OS' do
27
+ expect(subject.keys.sort).to eq [
28
+ 'debian-6-x86_64',
29
+ 'debian-7-x86_64',
30
+ 'redhat-5-x86_64',
31
+ 'redhat-6-x86_64',
32
+ 'redhat-7-x86_64',
33
+ ]
34
+ end
35
+ end
36
36
  end
37
37
 
38
38
  context 'When specifying supported_os' do
@@ -2,6 +2,10 @@ require 'coveralls'
2
2
  Coveralls.wear!
3
3
 
4
4
  require 'rspec'
5
+ require 'mocha/api'
5
6
  require 'rspec-puppet-facts'
6
7
  include RspecPuppetFacts
7
8
 
9
+ RSpec.configure do |config|
10
+ config.mock_framework = :mocha
11
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-puppet-facts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickaël Canévet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-04 00:00:00.000000000 Z
11
+ date: 2015-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mime-types
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: coveralls
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,20 @@ dependencies:
52
66
  - - "~>"
53
67
  - !ruby/object:Gem::Version
54
68
  version: '3.1'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mocha
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: json
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -70,16 +98,16 @@ dependencies:
70
98
  name: facter
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - "~>"
101
+ - - ">="
74
102
  - !ruby/object:Gem::Version
75
- version: '1.6'
103
+ version: '0'
76
104
  type: :runtime
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - "~>"
108
+ - - ">="
81
109
  - !ruby/object:Gem::Version
82
- version: '1.6'
110
+ version: '0'
83
111
  description: Contains facts from many Facter version on many Operating Systems
84
112
  email:
85
113
  - mickael.canevet@camptocamp.com
@@ -111,6 +139,10 @@ files:
111
139
  - facts/1.6/debian-8-x86_64.facts
112
140
  - facts/1.6/fedora-19-i386.facts
113
141
  - facts/1.6/fedora-19-x86_64.facts
142
+ - facts/1.6/opensuse-12-i386.facts
143
+ - facts/1.6/opensuse-12-x86_64.facts
144
+ - facts/1.6/opensuse-13-i386.facts
145
+ - facts/1.6/opensuse-13-x86_64.facts
114
146
  - facts/1.6/oraclelinux-5-i386.facts
115
147
  - facts/1.6/oraclelinux-5-x86_64.facts
116
148
  - facts/1.6/oraclelinux-6-i386.facts
@@ -153,6 +185,10 @@ files:
153
185
  - facts/1.7/debian-8-x86_64.facts
154
186
  - facts/1.7/fedora-19-i386.facts
155
187
  - facts/1.7/fedora-19-x86_64.facts
188
+ - facts/1.7/opensuse-12-i386.facts
189
+ - facts/1.7/opensuse-12-x86_64.facts
190
+ - facts/1.7/opensuse-13-i386.facts
191
+ - facts/1.7/opensuse-13-x86_64.facts
156
192
  - facts/1.7/oraclelinux-5-i386.facts
157
193
  - facts/1.7/oraclelinux-5-x86_64.facts
158
194
  - facts/1.7/oraclelinux-6-i386.facts
@@ -195,6 +231,10 @@ files:
195
231
  - facts/2.0/debian-8-x86_64.facts
196
232
  - facts/2.0/fedora-19-i386.facts
197
233
  - facts/2.0/fedora-19-x86_64.facts
234
+ - facts/2.0/opensuse-12-i386.facts
235
+ - facts/2.0/opensuse-12-x86_64.facts
236
+ - facts/2.0/opensuse-13-i386.facts
237
+ - facts/2.0/opensuse-13-x86_64.facts
198
238
  - facts/2.0/oraclelinux-5-i386.facts
199
239
  - facts/2.0/oraclelinux-5-x86_64.facts
200
240
  - facts/2.0/oraclelinux-6-i386.facts
@@ -237,6 +277,10 @@ files:
237
277
  - facts/2.1/debian-8-x86_64.facts
238
278
  - facts/2.1/fedora-19-i386.facts
239
279
  - facts/2.1/fedora-19-x86_64.facts
280
+ - facts/2.1/opensuse-12-i386.facts
281
+ - facts/2.1/opensuse-12-x86_64.facts
282
+ - facts/2.1/opensuse-13-i386.facts
283
+ - facts/2.1/opensuse-13-x86_64.facts
240
284
  - facts/2.1/oraclelinux-5-i386.facts
241
285
  - facts/2.1/oraclelinux-5-x86_64.facts
242
286
  - facts/2.1/oraclelinux-6-i386.facts
@@ -279,6 +323,10 @@ files:
279
323
  - facts/2.2/debian-8-x86_64.facts
280
324
  - facts/2.2/fedora-19-i386.facts
281
325
  - facts/2.2/fedora-19-x86_64.facts
326
+ - facts/2.2/opensuse-12-i386.facts
327
+ - facts/2.2/opensuse-12-x86_64.facts
328
+ - facts/2.2/opensuse-13-i386.facts
329
+ - facts/2.2/opensuse-13-x86_64.facts
282
330
  - facts/2.2/oraclelinux-5-i386.facts
283
331
  - facts/2.2/oraclelinux-5-x86_64.facts
284
332
  - facts/2.2/oraclelinux-6-i386.facts
@@ -321,6 +369,10 @@ files:
321
369
  - facts/2.3/debian-8-x86_64.facts
322
370
  - facts/2.3/fedora-19-i386.facts
323
371
  - facts/2.3/fedora-19-x86_64.facts
372
+ - facts/2.3/opensuse-12-i386.facts
373
+ - facts/2.3/opensuse-12-x86_64.facts
374
+ - facts/2.3/opensuse-13-i386.facts
375
+ - facts/2.3/opensuse-13-x86_64.facts
324
376
  - facts/2.3/oraclelinux-5-i386.facts
325
377
  - facts/2.3/oraclelinux-5-x86_64.facts
326
378
  - facts/2.3/oraclelinux-6-i386.facts