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 | |
---|
1 | require 'spec_helper'
|
---|
2 |
|
---|
3 | describe 'dos2unix' do
|
---|
4 | context 'Checking parameter validity' do
|
---|
5 | it { is_expected.not_to eq(nil) }
|
---|
6 | it do
|
---|
7 | is_expected.to run.with_params.and_raise_error(ArgumentError, /Wrong number of arguments/)
|
---|
8 | end
|
---|
9 | it do
|
---|
10 | is_expected.to run.with_params('one', 'two').and_raise_error(ArgumentError, /Wrong number of arguments/)
|
---|
11 | end
|
---|
12 | it do
|
---|
13 | is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError)
|
---|
14 | end
|
---|
15 | it do
|
---|
16 | is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError)
|
---|
17 | end
|
---|
18 | it do
|
---|
19 | is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError)
|
---|
20 | end
|
---|
21 | end
|
---|
22 |
|
---|
23 | context 'Converting from dos to unix format' do
|
---|
24 | sample_text = "Hello\r\nWorld\r\n"
|
---|
25 | desired_output = "Hello\nWorld\n"
|
---|
26 |
|
---|
27 | it 'should output unix format' do
|
---|
28 | should run.with_params(sample_text).and_return(desired_output)
|
---|
29 | end
|
---|
30 | end
|
---|
31 |
|
---|
32 | context 'Converting from unix to unix format' do
|
---|
33 | sample_text = "Hello\nWorld\n"
|
---|
34 | desired_output = "Hello\nWorld\n"
|
---|
35 |
|
---|
36 | it 'should output unix format' do
|
---|
37 | should run.with_params(sample_text).and_return(desired_output)
|
---|
38 | end
|
---|
39 | end
|
---|
40 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.