Please review pull request #714: Maint/2.7.x/fix busted colour tests opened by (daniel-pittman)

Description:

The stubbing in these tests blew up when an unexpected interaction happened;
it isn't clear why that was stubbed anyhow as we can just set settings
directly, to avoid exactly this failure mode.

Signed-off-by: Daniel Pittman [email protected]

  • Opened: Wed Apr 25 22:18:36 UTC 2012
  • Based on: puppetlabs:2.7.x (64348a0ea036fa6af20ef50b860bfda60c12c719)
  • Requested merge: daniel-pittman:maint/2.7.x/fix-busted-colour-tests (cde3bee077179e94d2e0eee50163012081411e28)

Diff follows:

diff --git a/spec/unit/util/log/destinations_spec.rb b/spec/unit/util/log/destinations_spec.rb
index 23e52a5..343551e 100755
--- a/spec/unit/util/log/destinations_spec.rb
+++ b/spec/unit/util/log/destinations_spec.rb
@@ -108,23 +108,23 @@
 describe Puppet::Util::Log.desttypes[:console] do
   describe "when color is available" do
     it "should support color output" do
-      Puppet.stubs(:[]).with(:color).returns(true)
+      Puppet[:color] = true
       subject.colorize(:red, 'version').should == "\e[0;31mversion\e[0m"
     end
 
     it "should withhold color output when not appropriate" do
-      Puppet.stubs(:[]).with(:color).returns(false)
+      Puppet[:color] = false
       subject.colorize(:red, 'version').should == "version"
     end
 
     it "should handle multiple overlapping colors in a stack-like way" do
-      Puppet.stubs(:[]).with(:color).returns(true)
+      Puppet[:color] = true
       vstring = subject.colorize(:red, 'version')
       subject.colorize(:green, "(#{vstring})").should == "\e[0;32m(\e[0;31mversion\e[0;32m)\e[0m"
     end
 
     it "should handle resets in a stack-like way" do
-      Puppet.stubs(:[]).with(:color).returns(true)
+      Puppet[:color] = true
       vstring = subject.colorize(:reset, 'version')
       subject.colorize(:green, "(#{vstring})").should == "\e[0;32m(\e[mversion\e[0;32m)\e[0m"
     end

    

--
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