summaryrefslogtreecommitdiff
path: root/spec/unit/parser/functions
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/parser/functions')
-rwxr-xr-xspec/unit/parser/functions/create_resources_spec.rb2
-rwxr-xr-xspec/unit/parser/functions/extlookup_spec.rb8
-rw-r--r--spec/unit/parser/functions/hiera_array_spec.rb2
-rw-r--r--spec/unit/parser/functions/hiera_hash_spec.rb2
-rw-r--r--spec/unit/parser/functions/hiera_include_spec.rb2
-rwxr-xr-xspec/unit/parser/functions/hiera_spec.rb2
-rwxr-xr-xspec/unit/parser/functions/regsubst_spec.rb8
-rwxr-xr-xspec/unit/parser/functions/split_spec.rb8
-rwxr-xr-xspec/unit/parser/functions/sprintf_spec.rb4
-rwxr-xr-xspec/unit/parser/functions/versioncmp_spec.rb8
10 files changed, 23 insertions, 23 deletions
diff --git a/spec/unit/parser/functions/create_resources_spec.rb b/spec/unit/parser/functions/create_resources_spec.rb
index a7a6e0074..f768eaccf 100755
--- a/spec/unit/parser/functions/create_resources_spec.rb
+++ b/spec/unit/parser/functions/create_resources_spec.rb
@@ -19,7 +19,7 @@ describe 'function for dynamically creating resources' do
end
it 'should require two or three arguments' do
- expect { @scope.function_create_resources(['foo']) }.to raise_error(ArgumentError, 'create_resources(): wrong number of arguments (1; must be 2 or 3)')
+ expect { @scope.function_create_resources(['foo']) }.to raise_error(ArgumentError, 'create_resources(): Wrong number of arguments given (1 for minimum 2)')
expect { @scope.function_create_resources(['foo', 'bar', 'blah', 'baz']) }.to raise_error(ArgumentError, 'create_resources(): wrong number of arguments (4; must be 2 or 3)')
end
diff --git a/spec/unit/parser/functions/extlookup_spec.rb b/spec/unit/parser/functions/extlookup_spec.rb
index 4bc2702b7..fae32fa97 100755
--- a/spec/unit/parser/functions/extlookup_spec.rb
+++ b/spec/unit/parser/functions/extlookup_spec.rb
@@ -19,12 +19,12 @@ describe "the extlookup function" do
Puppet::Parser::Functions.function("extlookup").should == "function_extlookup"
end
- it "should raise a ParseError if there is less than 1 arguments" do
- lambda { @scope.function_extlookup([]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is less than 1 arguments" do
+ lambda { @scope.function_extlookup([]) }.should( raise_error(ArgumentError))
end
- it "should raise a ParseError if there is more than 3 arguments" do
- lambda { @scope.function_extlookup(["foo", "bar", "baz", "gazonk"]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is more than 3 arguments" do
+ lambda { @scope.function_extlookup(["foo", "bar", "baz", "gazonk"]) }.should( raise_error(ArgumentError))
end
it "should return the default" do
diff --git a/spec/unit/parser/functions/hiera_array_spec.rb b/spec/unit/parser/functions/hiera_array_spec.rb
index d9e25cef0..e8efb727f 100644
--- a/spec/unit/parser/functions/hiera_array_spec.rb
+++ b/spec/unit/parser/functions/hiera_array_spec.rb
@@ -8,7 +8,7 @@ describe 'Puppet::Parser::Functions#hiera_array' do
let :scope do Puppet::Parser::Scope.new_for_test_harness('foo') end
it 'should require a key argument' do
- expect { scope.function_hiera_array([]) }.to raise_error(Puppet::ParseError)
+ expect { scope.function_hiera_array([]) }.to raise_error(ArgumentError)
end
it 'should raise a useful error when nil is returned' do
diff --git a/spec/unit/parser/functions/hiera_hash_spec.rb b/spec/unit/parser/functions/hiera_hash_spec.rb
index c7c9d4432..a345a6c7f 100644
--- a/spec/unit/parser/functions/hiera_hash_spec.rb
+++ b/spec/unit/parser/functions/hiera_hash_spec.rb
@@ -4,7 +4,7 @@ describe 'Puppet::Parser::Functions#hiera_hash' do
let :scope do Puppet::Parser::Scope.new_for_test_harness('foo') end
it 'should require a key argument' do
- expect { scope.function_hiera_hash([]) }.to raise_error(Puppet::ParseError)
+ expect { scope.function_hiera_hash([]) }.to raise_error(ArgumentError)
end
it 'should raise a useful error when nil is returned' do
diff --git a/spec/unit/parser/functions/hiera_include_spec.rb b/spec/unit/parser/functions/hiera_include_spec.rb
index 355afdd8d..de35293d3 100644
--- a/spec/unit/parser/functions/hiera_include_spec.rb
+++ b/spec/unit/parser/functions/hiera_include_spec.rb
@@ -4,7 +4,7 @@ describe 'Puppet::Parser::Functions#hiera_include' do
let :scope do Puppet::Parser::Scope.new_for_test_harness('foo') end
it 'should require a key argument' do
- expect { scope.function_hiera_include([]) }.to raise_error(Puppet::ParseError)
+ expect { scope.function_hiera_include([]) }.to raise_error(ArgumentError)
end
it 'should raise a useful error when nil is returned' do
diff --git a/spec/unit/parser/functions/hiera_spec.rb b/spec/unit/parser/functions/hiera_spec.rb
index 657d4f6fb..0abcb1b28 100755
--- a/spec/unit/parser/functions/hiera_spec.rb
+++ b/spec/unit/parser/functions/hiera_spec.rb
@@ -6,7 +6,7 @@ describe 'Puppet::Parser::Functions#hiera' do
let :scope do Puppet::Parser::Scope.new_for_test_harness('foo') end
it 'should require a key argument' do
- expect { scope.function_hiera([]) }.to raise_error(Puppet::ParseError)
+ expect { scope.function_hiera([]) }.to raise_error(ArgumentError)
end
it 'should raise a useful error when nil is returned' do
diff --git a/spec/unit/parser/functions/regsubst_spec.rb b/spec/unit/parser/functions/regsubst_spec.rb
index 439c16270..c75b16c0e 100755
--- a/spec/unit/parser/functions/regsubst_spec.rb
+++ b/spec/unit/parser/functions/regsubst_spec.rb
@@ -16,12 +16,12 @@ describe "the regsubst function" do
Puppet::Parser::Functions.function("regsubst").should == "function_regsubst"
end
- it "should raise a ParseError if there is less than 3 arguments" do
- lambda { @scope.function_regsubst(["foo", "bar"]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is less than 3 arguments" do
+ lambda { @scope.function_regsubst(["foo", "bar"]) }.should( raise_error(ArgumentError))
end
- it "should raise a ParseError if there is more than 5 arguments" do
- lambda { @scope.function_regsubst(["foo", "bar", "gazonk", "del", "x", "y"]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is more than 5 arguments" do
+ lambda { @scope.function_regsubst(["foo", "bar", "gazonk", "del", "x", "y"]) }.should( raise_error(ArgumentError))
end
diff --git a/spec/unit/parser/functions/split_spec.rb b/spec/unit/parser/functions/split_spec.rb
index 20a6f4204..5ddbe8d44 100755
--- a/spec/unit/parser/functions/split_spec.rb
+++ b/spec/unit/parser/functions/split_spec.rb
@@ -16,12 +16,12 @@ describe "the split function" do
Puppet::Parser::Functions.function("split").should == "function_split"
end
- it "should raise a ParseError if there is less than 2 arguments" do
- lambda { @scope.function_split(["foo"]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is less than 2 arguments" do
+ lambda { @scope.function_split(["foo"]) }.should( raise_error(ArgumentError))
end
- it "should raise a ParseError if there is more than 2 arguments" do
- lambda { @scope.function_split(["foo", "bar", "gazonk"]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is more than 2 arguments" do
+ lambda { @scope.function_split(["foo", "bar", "gazonk"]) }.should( raise_error(ArgumentError))
end
it "should raise a RegexpError if the regexp is malformed" do
diff --git a/spec/unit/parser/functions/sprintf_spec.rb b/spec/unit/parser/functions/sprintf_spec.rb
index e1d738e66..36c0ae1b7 100755
--- a/spec/unit/parser/functions/sprintf_spec.rb
+++ b/spec/unit/parser/functions/sprintf_spec.rb
@@ -16,8 +16,8 @@ describe "the sprintf function" do
Puppet::Parser::Functions.function("sprintf").should == "function_sprintf"
end
- it "should raise a ParseError if there is less than 1 argument" do
- lambda { @scope.function_sprintf([]) }.should( raise_error(Puppet::ParseError))
+ it "should raise a ArgumentError if there is less than 1 argument" do
+ lambda { @scope.function_sprintf([]) }.should( raise_error(ArgumentError))
end
it "should format integers" do
diff --git a/spec/unit/parser/functions/versioncmp_spec.rb b/spec/unit/parser/functions/versioncmp_spec.rb
index 5a6668678..760a286c5 100755
--- a/spec/unit/parser/functions/versioncmp_spec.rb
+++ b/spec/unit/parser/functions/versioncmp_spec.rb
@@ -16,12 +16,12 @@ describe "the versioncmp function" do
Puppet::Parser::Functions.function("versioncmp").should == "function_versioncmp"
end
- it "should raise a ParseError if there is less than 2 arguments" do
- lambda { @scope.function_versioncmp(["1.2"]) }.should raise_error(Puppet::ParseError)
+ it "should raise a ArgumentError if there is less than 2 arguments" do
+ lambda { @scope.function_versioncmp(["1.2"]) }.should raise_error(ArgumentError)
end
- it "should raise a ParseError if there is more than 2 arguments" do
- lambda { @scope.function_versioncmp(["1.2", "2.4.5", "3.5.6"]) }.should raise_error(Puppet::ParseError)
+ it "should raise a ArgumentError if there is more than 2 arguments" do
+ lambda { @scope.function_versioncmp(["1.2", "2.4.5", "3.5.6"]) }.should raise_error(ArgumentError)
end
it "should call Puppet::Util::Package.versioncmp (included in scope)" do