summaryrefslogtreecommitdiff
path: root/spec/acceptance/range_spec.rb
diff options
context:
space:
mode:
authorAshley Penney <ashley.penney@puppetlabs.com>2014-05-01 18:56:29 -0400
committerAshley Penney <ashley.penney@puppetlabs.com>2014-05-01 18:56:29 -0400
commit143a0078b01fdde118b19e89486b96644f1d5d7e (patch)
tree6bc2e63858bbbd2ce77c0d32bc35013c8b157888 /spec/acceptance/range_spec.rb
parentf8bfe46bbfa4a4737cef9a20cfe1bed04aee4bdc (diff)
parent80590a9bfe2a8c0d288125d17cfb9f01c8563a7a (diff)
downloadpuppet-stdlib-143a0078b01fdde118b19e89486b96644f1d5d7e.tar.gz
puppet-stdlib-143a0078b01fdde118b19e89486b96644f1d5d7e.tar.bz2
Merge pull request #244 from hunner/add_tests
Add more specs
Diffstat (limited to 'spec/acceptance/range_spec.rb')
-rw-r--r--spec/acceptance/range_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/acceptance/range_spec.rb b/spec/acceptance/range_spec.rb
new file mode 100644
index 0000000..0387e4e
--- /dev/null
+++ b/spec/acceptance/range_spec.rb
@@ -0,0 +1,35 @@
+require 'spec_helper_acceptance'
+
+describe 'range function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+ describe 'success' do
+ it 'ranges letters' do
+ pp = <<-EOS
+ $o = range('a','d')
+ notice(inline_template('range is <%= @o.inspect %>'))
+ EOS
+
+ apply_manifest(pp, :catch_failures => true) do |r|
+ expect(r.stdout).to match(/range is \["a", "b", "c", "d"\]/)
+ end
+ end
+ it 'ranges letters with a step' do
+ pp = <<-EOS
+ $o = range('a','d', '2')
+ notice(inline_template('range is <%= @o.inspect %>'))
+ EOS
+
+ apply_manifest(pp, :catch_failures => true) do |r|
+ expect(r.stdout).to match(/range is \["a", "c"\]/)
+ end
+ end
+ it 'ranges letters with a negative step'
+ it 'ranges numbers'
+ it 'ranges numbers with a step'
+ it 'ranges numbers with a negative step'
+ it 'ranges numeric strings'
+ it 'ranges zero padded numbers'
+ end
+ describe 'failure' do
+ it 'fails with no arguments'
+ end
+end