forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #528 from mhaskel/is_a_fixes
Update is_a acceptance tests to only run on puppet4
- Loading branch information
Showing
2 changed files
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
#! /usr/bin/env ruby -S rspec | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'is_a function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do | ||
it 'should match a string' do | ||
pp = <<-EOS | ||
if 'hello world'.is_a(String) { | ||
notify { 'output correct': } | ||
} | ||
EOS | ||
if get_puppet_version =~ /^4/ | ||
describe 'is_a function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do | ||
it 'should match a string' do | ||
pp = <<-EOS | ||
if 'hello world'.is_a(String) { | ||
notify { 'output correct': } | ||
} | ||
EOS | ||
|
||
apply_manifest(pp, :catch_failures => true) do |r| | ||
expect(r.stdout).to match(/Notice: output correct/) | ||
apply_manifest(pp, :catch_failures => true) do |r| | ||
expect(r.stdout).to match(/Notice: output correct/) | ||
end | ||
end | ||
end | ||
|
||
it 'should not match a integer as string' do | ||
pp = <<-EOS | ||
if 5.is_a(String) { | ||
notify { 'output wrong': } | ||
} | ||
EOS | ||
it 'should not match a integer as string' do | ||
pp = <<-EOS | ||
if 5.is_a(String) { | ||
notify { 'output wrong': } | ||
} | ||
EOS | ||
|
||
apply_manifest(pp, :catch_failures => true) do |r| | ||
expect(r.stdout).not_to match(/Notice: output wrong/) | ||
apply_manifest(pp, :catch_failures => true) do |r| | ||
expect(r.stdout).not_to match(/Notice: output wrong/) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters