]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/acceptance/range_spec.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / range_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
3
4 describe 'range function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5   describe 'success' do
6     it 'ranges letters' do
7       pp = <<-EOS
8       $o = range('a','d')
9       notice(inline_template('range is <%= @o.inspect %>'))
10       EOS
11
12       apply_manifest(pp, :catch_failures => true) do |r|
13         expect(r.stdout).to match(/range is \["a", "b", "c", "d"\]/)
14       end
15     end
16     it 'ranges letters with a step' do
17       pp = <<-EOS
18       $o = range('a','d', '2')
19       notice(inline_template('range is <%= @o.inspect %>'))
20       EOS
21
22       apply_manifest(pp, :catch_failures => true) do |r|
23         expect(r.stdout).to match(/range is \["a", "c"\]/)
24       end
25     end
26     it 'ranges letters with a negative step'
27     it 'ranges numbers'
28     it 'ranges numbers with a step'
29     it 'ranges numbers with a negative step'
30     it 'ranges numeric strings'
31     it 'ranges zero padded numbers'
32   end
33   describe 'failure' do
34     it 'fails with no arguments'
35   end
36 end