source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_join_spec.rb@ 30960

Last change on this file since 30960 was 30960, checked in by davidb, 7 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

File size: 1.1 KB
Line 
1require 'spec_helper'
2
3describe 'shell_join' do
4 it { is_expected.not_to eq(nil) }
5
6 describe 'signature validation' do
7 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
8 it { is_expected.to run.with_params(['foo'], ['bar']).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
9 it { is_expected.to run.with_params('foo').and_raise_error(Puppet::ParseError, /is not an Array/i) }
10 end
11
12 describe 'shell argument joining' do
13 it { is_expected.to run.with_params(['foo']).and_return('foo') }
14 it { is_expected.to run.with_params(['foo', 'bar']).and_return('foo bar') }
15 it { is_expected.to run.with_params(['foo', 'bar baz']).and_return('foo bar\ baz') }
16 it { is_expected.to run.with_params(['~`!@#$', '%^&*()_+-=', '[]\{}|;\':"', ',./<>?'])
17 .and_return('\~\`\!@\#\$ \%\^\&\*\(\)_\+-\= \[\]\\\\\{\}\|\;\\\':\" ,./\<\>\?') }
18 end
19
20 describe 'stringification' do
21 it { is_expected.to run.with_params([10, false, 'foo']).and_return('10 false foo') }
22 end
23end
Note: See TracBrowser for help on using the repository browser.