inspec 0.21.4 → 0.21.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -2
- data/lib/inspec/objects/test.rb +1 -1
- data/lib/inspec/version.rb +1 -1
- data/test/unit/objects_test.rb +56 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7987ef3cfd302898ec17ef7f18e3e22f9e458449
|
4
|
+
data.tar.gz: 76cf8de1700446eb2eb7b1fe1b2478a4aec63d18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 008eebc069872f28e8ff1e42d9b087673ecc988cffd50a2fd6e98d7ae9f5bfd4fc98efdb0c4336f67f462e0770af4225de04d5069013caab7827a14b86b7d772
|
7
|
+
data.tar.gz: 537d9fdd3fb0af2a8bde463f2d28b3e76cdf512ec76f5b3e6cf621fb25e789bd1d133e39240dfa7751e72fd08af1aae94277a3a474b589175192167b31018c67
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.21.
|
4
|
-
[Full Changelog](https://github.com/chef/inspec/compare/v0.21.
|
3
|
+
## [0.21.5](https://github.com/chef/inspec/tree/0.21.5) (2016-05-13)
|
4
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v0.21.4...0.21.5)
|
5
|
+
|
6
|
+
**Fixed bugs:**
|
7
|
+
|
8
|
+
- fix construction of ruby objects on string and array handlers [\#746](https://github.com/chef/inspec/pull/746) ([arlimus](https://github.com/arlimus))
|
9
|
+
|
10
|
+
## [v0.21.4](https://github.com/chef/inspec/tree/v0.21.4) (2016-05-13)
|
11
|
+
[Full Changelog](https://github.com/chef/inspec/compare/v0.21.3...v0.21.4)
|
5
12
|
|
6
13
|
**Implemented enhancements:**
|
7
14
|
|
data/lib/inspec/objects/test.rb
CHANGED
@@ -49,7 +49,7 @@ module Inspec
|
|
49
49
|
if @qualifier.length > 1
|
50
50
|
last = @qualifier[-1]
|
51
51
|
# preventing its('to_i') as the value returned is always 0
|
52
|
-
if last.length == 1 && last[0]
|
52
|
+
if last.length == 1 && last[0] !~ /^to_.$/ && !last[0].include?('[')
|
53
53
|
xres = last[0]
|
54
54
|
else
|
55
55
|
res += '.' + ruby_qualifier(last)
|
data/lib/inspec/version.rb
CHANGED
@@ -0,0 +1,56 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# author: Dominik Richter
|
3
|
+
# author: Christoph Hartmann
|
4
|
+
|
5
|
+
require 'helper'
|
6
|
+
require 'inspec/objects'
|
7
|
+
|
8
|
+
describe 'Objects' do
|
9
|
+
describe 'Test' do
|
10
|
+
let(:obj) { Inspec::Test.new }
|
11
|
+
it 'constructs a simple resource+argument' do
|
12
|
+
obj.qualifier = [['resource'], ['arg']]
|
13
|
+
obj.to_ruby.must_equal "
|
14
|
+
describe resource do
|
15
|
+
its(\"arg\") { should }
|
16
|
+
end
|
17
|
+
".strip
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'constructs a simple resource+argument with to_s' do
|
21
|
+
obj.qualifier = [['resource'], ['to_s']]
|
22
|
+
obj.to_ruby.must_equal "
|
23
|
+
describe resource.to_s do
|
24
|
+
it { should }
|
25
|
+
end
|
26
|
+
".strip
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'constructs a simple resource+argument with to_i' do
|
30
|
+
obj.qualifier = [['resource'], ['to_i']]
|
31
|
+
obj.to_ruby.must_equal "
|
32
|
+
describe resource.to_i do
|
33
|
+
it { should }
|
34
|
+
end
|
35
|
+
".strip
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'constructs a simple resource+argument with array accessors' do
|
39
|
+
obj.qualifier = [['resource'], ['name[2]']]
|
40
|
+
obj.to_ruby.must_equal "
|
41
|
+
describe resource.name[2] do
|
42
|
+
it { should }
|
43
|
+
end
|
44
|
+
".strip
|
45
|
+
end
|
46
|
+
|
47
|
+
it 'constructs a simple resource+argument with method calls' do
|
48
|
+
obj.qualifier = [['resource'], ['hello', 'world']]
|
49
|
+
obj.to_ruby.must_equal "
|
50
|
+
describe resource.hello(\"world\") do
|
51
|
+
it { should }
|
52
|
+
end
|
53
|
+
".strip
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
@@ -558,6 +558,7 @@ files:
|
|
558
558
|
- test/unit/mock/profiles/skippy-profile-os/inspec.yml
|
559
559
|
- test/unit/mock/profiles/supported_inspec/inspec.yml
|
560
560
|
- test/unit/mock/profiles/unsupported_inspec/inspec.yml
|
561
|
+
- test/unit/objects_test.rb
|
561
562
|
- test/unit/plugin_test.rb
|
562
563
|
- test/unit/plugins/resource_test.rb
|
563
564
|
- test/unit/profile_context_test.rb
|
@@ -835,6 +836,7 @@ test_files:
|
|
835
836
|
- test/unit/mock/profiles/skippy-profile-os/inspec.yml
|
836
837
|
- test/unit/mock/profiles/supported_inspec/inspec.yml
|
837
838
|
- test/unit/mock/profiles/unsupported_inspec/inspec.yml
|
839
|
+
- test/unit/objects_test.rb
|
838
840
|
- test/unit/plugin_test.rb
|
839
841
|
- test/unit/plugins/resource_test.rb
|
840
842
|
- test/unit/profile_context_test.rb
|