From: Daniel Pittman <[email protected]>

When this test was implemented the 'inspect' application had not yet landed,
the introduction of which caused a test failure to crop up.  It also compared
two arrays that were not inherently ordered, allowing gratuitous test failures
to creep on in.
---
 spec/unit/util/command_line_spec.rb |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
 mode change 100644 => 100755 spec/unit/util/command_line_spec.rb

diff --git a/spec/unit/util/command_line_spec.rb 
b/spec/unit/util/command_line_spec.rb
old mode 100644
new mode 100755
index a648eb4..d229ceb
--- a/spec/unit/util/command_line_spec.rb
+++ b/spec/unit/util/command_line_spec.rb
@@ -108,8 +108,8 @@ describe Puppet::Util::CommandLine do
   end
   describe 'when loading commands' do
     before do
-      @core_apps = ["describe", "filebucket", "kick", "queue", "resource", 
"agent", "cert", "apply", "doc", "master"]
-      @command_line = Puppet::Util::CommandLine.new("foo", %w{ client --help w 
   hatever.pp }, @tty )
+      @core_apps = %w{inspect describe filebucket kick queue resource agent 
cert apply doc master}.sort
+      @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|
@@ -122,10 +122,14 @@ describe Puppet::Util::CommandLine do
         @appdir="#{@dir}/puppet/application"
         FileUtils.mkdir_p(@appdir)
         FileUtils.touch("#{@appdir}/foo.rb")
-        $LOAD_PATH.unshift(@dir)
+        $LOAD_PATH.unshift(@dir) # WARNING: MUST MATCH THE AFTER ACTIONS!
       end
       it 'should be able to find commands from both paths' do
-        @command_line.available_subcommands.should == ['foo'] + @core_apps
+        expect = ['foo'] + @core_apps
+        @command_line.available_subcommands.sort.should == expect.sort
+      end
+      after do
+        $LOAD_PATH.shift        # WARNING: MUST MATCH THE BEFORE ACTIONS!
       end
     end
   end
-- 
1.7.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to