diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-03-06 20:42:39 -0800 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-03-07 14:02:17 -0800 |
commit | 28095d7435bcab15b76ddfa4435d61653f2f890d (patch) | |
tree | 74ae5f037aaee78ed31de178c6e6f4203e9d7959 /spec/unit/util/command_line_spec.rb | |
parent | 6869385300dc694c4f087e134949dff9e1e43df9 (diff) | |
parent | e8145f91debc863b341a270e1d8cff6c43d93ef5 (diff) | |
download | puppet-28095d7435bcab15b76ddfa4435d61653f2f890d.tar.gz puppet-28095d7435bcab15b76ddfa4435d61653f2f890d.tar.xz puppet-28095d7435bcab15b76ddfa4435d61653f2f890d.zip |
Merge branch '2.6.next' into next
This was a particularly nasty merge, so rather than hold up merges into
next any longer, I'm going to push this merge with a few outstanding
problems. The tests that were failing in the following areas have been
marked pending, and will be addressed separately, immediately following
this push.
TODO:
Verify that brice's rdoc change is still valid: tests to show that line
numbers from class, define and node get into the ast
Fix mount parsed_spec spec/unit/provider/mount/parsed_spec.rb
* 2.6.next: (85 commits)
(#5148) Fix failing spec due to timezone
(#5148) Add support for PSON to facts
(#6338) Remove inventory indirection, and move to facts indirection
(#6445) Fix inline docs: puppet agent does not accept --mkusers
Update CHANGELOG and version for 2.6.6rc1
(#6541) Fix content with checksum truncation bug
(#6418) Recursive files shouldn't be audited
(#6541) maint: whitespace cleanup on the file integration spec
(#6541) Fix content with checksum truncation bug
(#5466) Write specs for output of puppet resource
(#5466) Monkey patch Symbol so that you can sort them
(#5466) Fixed puppet resource bug with trailing ,
Update CHANGELOG for 2.6.5
(#4922) Don't truncate remotely-sourced files on 404
(#6338) Remove unused version control tags
Maint: Align tabs in a code block in the Augeas type.
(#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type
Maint: Rewrite comments about symlinks to reflect best practice.
(#6509) Inline docs: Fix broken lists in Launchd provider.
(#6509) Inline docs: Fix broken code blocks in zpool type
...
Manually Resolved Conflicts:
lib/puppet/application/inspect.rb
lib/puppet/defaults.rb
lib/puppet/file_bucket/dipper.rb
lib/puppet/network/http/handler.rb
lib/puppet/node/facts.rb
lib/puppet/parser/parser.rb
lib/puppet/parser/parser_support.rb
lib/puppet/util/command_line/puppet
lib/puppet/util/command_line/puppetd
lib/puppet/util/command_line/puppetmasterd
lib/puppet/util/monkey_patches.rb
lib/puppet/util/rdoc/parser.rb
spec/unit/application/agent_spec.rb
spec/unit/file_bucket/file_spec.rb
spec/unit/indirector/file_bucket_file/file_spec.rb
spec/unit/network/http/handler_spec.rb
spec/unit/parser/parser_spec.rb
spec/unit/provider/mount/parsed_spec.rb
Diffstat (limited to 'spec/unit/util/command_line_spec.rb')
-rwxr-xr-x[-rw-r--r--] | spec/unit/util/command_line_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb index 7ba965249..98ddb92f6 100644..100755 --- a/spec/unit/util/command_line_spec.rb +++ b/spec/unit/util/command_line_spec.rb @@ -6,6 +6,7 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f require 'puppet/util/command_line' describe Puppet::Util::CommandLine do + include PuppetSpec::Files before do @tty = stub("tty", :tty? => true ) @pipe = stub("pipe", :tty? => false) @@ -105,4 +106,32 @@ describe Puppet::Util::CommandLine do end end end + describe 'when loading commands' do + before do + @core_apps = %w{describe filebucket kick queue resource agent cert apply doc master} + @command_line = Puppet::Util::CommandLine.new("foo", %w{ client --help whatever.pp }, @tty ) + end + it 'should be able to find all existing commands' do + @core_apps.each do |command| + @command_line.available_subcommands.should include command + end + end + describe 'when multiple paths have applications' do + before do + @dir=tmpdir('command_line_plugin_test') + @appdir="#{@dir}/puppet/application" + FileUtils.mkdir_p(@appdir) + FileUtils.touch("#{@appdir}/foo.rb") + $LOAD_PATH.unshift(@dir) # WARNING: MUST MATCH THE AFTER ACTIONS! + end + it 'should be able to find commands from both paths' do + found = @command_line.available_subcommands + found.should include 'foo' + @core_apps.each { |cmd| found.should include cmd } + end + after do + $LOAD_PATH.shift # WARNING: MUST MATCH THE BEFORE ACTIONS! + end + end + end end |