Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/stable'
Browse files Browse the repository at this point in the history
* upstream/stable:
  (maint) Fix failing test caused by databinding being in effect
  (PUP-4537) Skip rdoc tests on windows
  (PUP-4777) Allow hiera 3 as a puppet dependency
  (PUP-4749) testdir incorrectly used in calling all functions test
  (PUP-3539) add specs globbing ACL in fileserver.conf
  • Loading branch information
joshcooper committed Jun 25, 2015
2 parents b247dab + 64b1cdc commit 7891fcb
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 36 deletions.
6 changes: 3 additions & 3 deletions .gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ Gem::Specification.new do |s|

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<facter>, [">= 1.7", "< 3"])
s.add_runtime_dependency(%q<hiera>, [">= 2.0", "< 3"])
s.add_runtime_dependency(%q<hiera>, [">= 2.0", "< 4"])
else
s.add_dependency(%q<facter>, [">= 1.7", "< 3"])
s.add_dependency(%q<hiera>, [">= 2.0", "< 3"])
s.add_dependency(%q<hiera>, [">= 2.0", "< 4"])
end
else
s.add_dependency(%q<facter>, [">= 1.7", "< 3"])
s.add_dependency(%q<hiera>, [">= 2.0", "< 3"])
s.add_dependency(%q<hiera>, [">= 2.0", "< 4"])
end
end
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end

gem "puppet", :path => File.dirname(__FILE__), :require => false
gem "facter", *location_for(ENV['FACTER_LOCATION'] || ['> 2.0', '< 4'])
gem "hiera", *location_for(ENV['HIERA_LOCATION'] || ['>= 2.0', '< 3'])
gem "hiera", *location_for(ENV['HIERA_LOCATION'] || ['>= 2.0', '< 4'])
gem "rake", "10.1.1", :require => false

group(:development, :test) do
Expand Down
2 changes: 1 addition & 1 deletion ext/project_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ gem_default_executables: 'puppet'
gem_forge_project: 'puppet'
gem_runtime_dependencies:
facter: ['> 2.0', '< 4']
hiera: ['>= 2.0', '< 3']
hiera: ['>= 2.0', '< 4']
json_pure:
gem_rdoc_options:
- --title
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/util/rdoc/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'spec_helper'
require 'puppet/util/rdoc'

describe "RDoc::Parser" do
describe "RDoc::Parser", :unless => Puppet.features.microsoft_windows? do
require 'puppet_spec/files'
include PuppetSpec::Files

Expand Down
55 changes: 25 additions & 30 deletions spec/unit/file_serving/configuration/parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ def write_config_file(content)
expect { @parser.parse }.not_to raise_error
end

it "should create a new mount for each section in the configuration" do
mount1 = mock 'one', :validate => true
mount2 = mock 'two', :validate => true
Puppet::FileServing::Mount::File.expects(:new).with("one").returns(mount1)
Puppet::FileServing::Mount::File.expects(:new).with("two").returns(mount2)
write_config_file "[one]\n[two]\n"
@parser.parse
end

# This test is almost the exact same as the previous one.
it "should return a hash of the created mounts" do
mount1 = mock 'one', :validate => true
mount2 = mock 'two', :validate => true
Expand Down Expand Up @@ -108,29 +98,34 @@ def write_config_file(content)
@parser.parse
end

it "should tell the mount to allow any allow values from the section" do
write_config_file "[one]\nallow something\n"
[:allow,:deny].each { |acl_type|
it "should support inline comments in #{acl_type}" do
write_config_file "[one]\n#{acl_type} something \# will it work?\n"

@mount.expects(:info)
@mount.expects(:allow).with("something")
@mount.expects(acl_type).with("something")
@parser.parse
end

it "should support inline comments" do
write_config_file "[one]\nallow something \# will it work?\n"

@mount.expects(:info)
@mount.expects(:allow).with("something")
@parser.parse
end

it "should tell the mount to deny any deny values from the section" do
write_config_file "[one]\ndeny something\n"

@mount.expects(:info)
@mount.expects(:deny).with("something")
@parser.parse
end
end

it "should tell the mount to #{acl_type} from ACLs with varying spacing around commas" do
write_config_file "[one]\n#{acl_type} someone,sometwo, somethree , somefour ,somefive\n"

@mount.expects(:info).times(5)
@mount.expects(acl_type).times(5).with(any_of('someone','sometwo','somethree','somefour','somefive'))
@parser.parse
end

# each ip, with glob in the various octet positions
['100','4','42','*'].permutation.map {|permutes| permutes.join('.') }.each { |ip_pattern|
it "should tell the mount to #{acl_type} from ACLs with glob at #{ip_pattern}" do
write_config_file "[one]\n#{acl_type} #{ip_pattern}\n"

@mount.expects(:info)
@mount.expects(acl_type).with(ip_pattern)
@parser.parse
end
}
}

it "should return comprehensible error message, if failed on invalid attribute" do
write_config_file "[one]\ndo something\n"
Expand Down
1 change: 1 addition & 0 deletions spec/unit/pops/evaluator/evaluating_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
include PuppetSpec::Scope
before(:each) do
Puppet[:strict_variables] = true
Puppet[:data_binding_terminus] = 'none'

# Tests needs a known configuration of node/scope/compiler since it parses and evaluates
# snippets as the compiler will evaluate them, butwithout the overhead of compiling a complete
Expand Down

0 comments on commit 7891fcb

Please sign in to comment.