debian/bullseye
debian/jessie
|
Last change
on this file since 2661426 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:
1.2 KB
|
| Line | |
|---|
| 1 | #! /usr/bin/env ruby -S rspec
|
|---|
| 2 | require 'spec_helper_acceptance'
|
|---|
| 3 |
|
|---|
| 4 | describe 'empty function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
|---|
| 5 | describe 'success' do
|
|---|
| 6 | it 'recognizes empty strings' do
|
|---|
| 7 | pp = <<-EOS
|
|---|
| 8 | $a = ''
|
|---|
| 9 | $b = true
|
|---|
| 10 | $o = empty($a)
|
|---|
| 11 | if $o == $b {
|
|---|
| 12 | notify { 'output correct': }
|
|---|
| 13 | }
|
|---|
| 14 | EOS
|
|---|
| 15 |
|
|---|
| 16 | apply_manifest(pp, :catch_failures => true) do |r|
|
|---|
| 17 | expect(r.stdout).to match(/Notice: output correct/)
|
|---|
| 18 | end
|
|---|
| 19 | end
|
|---|
| 20 | it 'recognizes non-empty strings' do
|
|---|
| 21 | pp = <<-EOS
|
|---|
| 22 | $a = 'aoeu'
|
|---|
| 23 | $b = false
|
|---|
| 24 | $o = empty($a)
|
|---|
| 25 | if $o == $b {
|
|---|
| 26 | notify { 'output correct': }
|
|---|
| 27 | }
|
|---|
| 28 | EOS
|
|---|
| 29 |
|
|---|
| 30 | apply_manifest(pp, :catch_failures => true) do |r|
|
|---|
| 31 | expect(r.stdout).to match(/Notice: output correct/)
|
|---|
| 32 | end
|
|---|
| 33 | end
|
|---|
| 34 | it 'handles numerical values' do
|
|---|
| 35 | pp = <<-EOS
|
|---|
| 36 | $a = 7
|
|---|
| 37 | $b = false
|
|---|
| 38 | $o = empty($a)
|
|---|
| 39 | if $o == $b {
|
|---|
| 40 | notify { 'output correct': }
|
|---|
| 41 | }
|
|---|
| 42 | EOS
|
|---|
| 43 |
|
|---|
| 44 | apply_manifest(pp, :catch_failures => true) do |r|
|
|---|
| 45 | expect(r.stdout).to match(/Notice: output correct/)
|
|---|
| 46 | end
|
|---|
| 47 | end
|
|---|
| 48 | end
|
|---|
| 49 | describe 'failure' do
|
|---|
| 50 | it 'handles improper argument counts'
|
|---|
| 51 | it 'handles non-strings'
|
|---|
| 52 | end
|
|---|
| 53 | end
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.