inspec/test
Adam Leff 4f2b66302d Fix ObjectTraverser when accessing array values
When attempting to access array values via the `json` resource:

```
describe json('/tmp/test.json') do
      its(['array',0]) { should eq "zero" }
end
```

... the resulting data would be an array of the size of the original array
with all the values replaced with nils:

```
     expected: "zero"
          got: [nil, nil, nil]
```

This was due to a bug in the ObjectTraverser mixin that mapped array values
back through `extract_value` rather than properly handling the passed-in
key(s). This worked fine for the specific data format created by the `csv`
resource but did not work `json` or any other resource that subclassed the
`JsonConfig` resource.

This change fixes the logic when dealing with an array when it's encountered,
and fixes up the `csv` resource with its own `value` method.

This change also adds tests for ObjectTraverser.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-15 11:35:55 +01:00
..
cookbooks/os_prepare call ssh cookbook from prepare cookbook 2017-01-03 11:40:09 +01:00
functional Merge pull request #1454 from jkerry/FunctionalJUnitReporter 2017-02-27 12:00:36 -05:00
integration/default add fallback syntax for serverspec tests 2016-12-15 16:16:17 +01:00
resource Add FreeBSD support for ZFS datasets and pools 2017-02-22 10:29:49 -07:00
unit Fix ObjectTraverser when accessing array values 2017-03-15 11:35:55 +01:00
docker_run.rb travis experiment: lower docker concurrency 2016-08-10 12:52:21 +01:00
docker_test.rb Load all dependent libraries, even if include_context isn't called 2016-09-04 20:55:20 +02:00
helper.rb Merge pull request #1501 from jbenden/jbenden/freebsd-zfs 2017-03-01 13:06:44 -05:00
test-extra.yaml split up tests for travis 2015-09-23 01:51:51 +02:00
test.yaml split up tests for travis 2015-09-23 01:51:51 +02:00