debian/bullseye
debian/jessie
|
Last change
on this file since 9baac5a was 1c22429, checked in by Joachim Langenbach <joachim.langenbach@…>, 10 years ago |
- gnuboat_epd adds the apt repository from gnuboat to install epd-fuse package
|
-
Property mode
set to
100755
|
|
File size:
985 bytes
|
| Line | |
|---|
| 1 | #! /usr/bin/env ruby -S rspec
|
|---|
| 2 | require 'spec_helper_acceptance'
|
|---|
| 3 |
|
|---|
| 4 | describe 'values function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
|---|
| 5 | describe 'success' do
|
|---|
| 6 | it 'returns an array of values' do
|
|---|
| 7 | pp = <<-EOS
|
|---|
| 8 | $arg = {
|
|---|
| 9 | 'a' => 1,
|
|---|
| 10 | 'b' => 2,
|
|---|
| 11 | 'c' => 3,
|
|---|
| 12 | }
|
|---|
| 13 | $output = values($arg)
|
|---|
| 14 | notice(inline_template('<%= @output.sort.inspect %>'))
|
|---|
| 15 | EOS
|
|---|
| 16 | if is_future_parser_enabled?
|
|---|
| 17 | expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[1, 2, 3\]/)
|
|---|
| 18 | else
|
|---|
| 19 | expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["1", "2", "3"\]/)
|
|---|
| 20 | end
|
|---|
| 21 |
|
|---|
| 22 | end
|
|---|
| 23 | end
|
|---|
| 24 | describe 'failure' do
|
|---|
| 25 | it 'handles non-hash arguments' do
|
|---|
| 26 | pp = <<-EOS
|
|---|
| 27 | $arg = "foo"
|
|---|
| 28 | $output = values($arg)
|
|---|
| 29 | notice(inline_template('<%= @output.inspect %>'))
|
|---|
| 30 | EOS
|
|---|
| 31 |
|
|---|
| 32 | expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/Requires hash/)
|
|---|
| 33 | end
|
|---|
| 34 | end
|
|---|
| 35 | end
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.