Skip to content

Commit 89675b1

Browse files
ghoneycuttpmcmaw
authored andcommitted
(MODULES-6216) Add acceptance tests for type3x() function
1 parent ef26708 commit 89675b1

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

spec/acceptance/type3x_spec.rb

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /usr/bin/env ruby -S rspec
2+
require 'spec_helper_acceptance'
3+
4+
describe 'type3x function' do
5+
describe 'success' do
6+
{
7+
%{type3x({ 'a' => 'hash' })} => 'Hash',
8+
%{type3x(['array'])} => 'Array',
9+
%{type3x(false)} => 'Boolean',
10+
%{type3x('asdf')} => 'String',
11+
%{type3x(242)} => 'Integer',
12+
%{type3x(3.14)} => 'Float',
13+
}.each do |pp, type|
14+
it "with type #{type}" do
15+
apply_manifest(pp, :catch_failures => true)
16+
end
17+
end
18+
end
19+
20+
describe 'failure' do
21+
pp_fail = <<-EOS
22+
type3x('one','two')
23+
EOS
24+
it 'handles improper number of arguments' do
25+
expect(apply_manifest(pp_fail, :expect_failures => true).stderr).to match(%r{Wrong number of arguments})
26+
end
27+
end
28+
end

0 commit comments

Comments
 (0)