blob: 8e056424ed6f33234b90069e5b985cfb88471b01 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'
describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
describe 'success' do
it 'should accept a string' do
pp = <<-EOS
$input = '-34.56'
$output = abs($input)
notify { $output: }
EOS
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stdout).to match(/Notice: 34.56/)
end
end
it 'should accept a float' do
pp = <<-EOS
$input = -34.56
$output = abs($input)
notify { $output: }
EOS
apply_manifest(pp, :catch_failures => true) do |r|
expect(r.stdout).to match(/Notice: 34.56/)
end
end
end
end
|