summaryrefslogtreecommitdiff
path: root/spec/unit/puppet
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2014-03-18 16:16:00 -0700
committerHunter Haugen <hunter@puppetlabs.com>2014-03-18 16:16:00 -0700
commit904f1a003e790ba2afaf3452ecda9805e87d80d0 (patch)
tree93407d68868c37af5d597d33134ba5a16e919a21 /spec/unit/puppet
parentdb00ce660520abfdc110d1ed0dd10bfbc708e256 (diff)
parentfec943f441f0c6ab8d6b685091d3418ec0e265b4 (diff)
Merge branch '3.2.x' into 3.x
Diffstat (limited to 'spec/unit/puppet')
-rw-r--r--spec/unit/puppet/parser/functions/merge_spec.rb7
-rw-r--r--spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb4
-rw-r--r--spec/unit/puppet/provider/file_line/ruby_spec.rb2
-rw-r--r--spec/unit/puppet/type/anchor_spec.rb2
-rw-r--r--spec/unit/puppet/type/file_line_spec.rb2
5 files changed, 11 insertions, 6 deletions
diff --git a/spec/unit/puppet/parser/functions/merge_spec.rb b/spec/unit/puppet/parser/functions/merge_spec.rb
index db7d837..79079b6 100644
--- a/spec/unit/puppet/parser/functions/merge_spec.rb
+++ b/spec/unit/puppet/parser/functions/merge_spec.rb
@@ -25,7 +25,12 @@ describe Puppet::Parser::Functions.function(:merge) do
describe 'when calling merge on the scope instance' do
it 'should require all parameters are hashes' do
- expect { new_hash = scope.function_merge([{}, '2'])}.should raise_error(Puppet::ParseError, /unexpected argument type String/)
+ expect { new_hash = scope.function_merge([{}, '2'])}.to raise_error(Puppet::ParseError, /unexpected argument type String/)
+ expect { new_hash = scope.function_merge([{}, 2])}.to raise_error(Puppet::ParseError, /unexpected argument type Fixnum/)
+ end
+
+ it 'should accept empty strings as puppet undef' do
+ expect { new_hash = scope.function_merge([{}, ''])}.to raise_error
end
it 'should be able to merge two hashes' do
diff --git a/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb b/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb
index 08aaf78..1c9cce2 100644
--- a/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb
+++ b/spec/unit/puppet/parser/functions/validate_absolute_path_spec.rb
@@ -35,7 +35,7 @@ describe Puppet::Parser::Functions.function(:validate_absolute_path) do
end
valid_paths.each do |path|
it "validate_absolute_path(#{path.inspect}) should not fail" do
- expect { subject.call [path] }.not_to raise_error Puppet::ParseError
+ expect { subject.call [path] }.not_to raise_error
end
end
end
@@ -43,7 +43,7 @@ describe Puppet::Parser::Functions.function(:validate_absolute_path) do
context "Puppet without mocking" do
valid_paths.each do |path|
it "validate_absolute_path(#{path.inspect}) should not fail" do
- expect { subject.call [path] }.not_to raise_error Puppet::ParseError
+ expect { subject.call [path] }.not_to raise_error
end
end
end
diff --git a/spec/unit/puppet/provider/file_line/ruby_spec.rb b/spec/unit/puppet/provider/file_line/ruby_spec.rb
index 7857d39..50f5840 100644
--- a/spec/unit/puppet/provider/file_line/ruby_spec.rb
+++ b/spec/unit/puppet/provider/file_line/ruby_spec.rb
@@ -1,4 +1,4 @@
-require 'puppet'
+require 'spec_helper'
require 'tempfile'
provider_class = Puppet::Type.type(:file_line).provider(:ruby)
describe provider_class do
diff --git a/spec/unit/puppet/type/anchor_spec.rb b/spec/unit/puppet/type/anchor_spec.rb
index 2030b83..f92065f 100644
--- a/spec/unit/puppet/type/anchor_spec.rb
+++ b/spec/unit/puppet/type/anchor_spec.rb
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
-require 'puppet'
+require 'spec_helper'
anchor = Puppet::Type.type(:anchor).new(:name => "ntp::begin")
diff --git a/spec/unit/puppet/type/file_line_spec.rb b/spec/unit/puppet/type/file_line_spec.rb
index 0cd8a26..37f3861 100644
--- a/spec/unit/puppet/type/file_line_spec.rb
+++ b/spec/unit/puppet/type/file_line_spec.rb
@@ -1,4 +1,4 @@
-require 'puppet'
+require 'spec_helper'
require 'tempfile'
describe Puppet::Type.type(:file_line) do
let :file_line do