On May 1, 2011, at 1:33 PM, Stefan Schulte wrote: > > Signed-off-by: Stefan Schulte <[email protected]> > --- > Local-branch: ticket/2.7.x/7299 > .../unit/util/network_device/transport/ssh_spec.rb | 5 +++-- > 1 files changed, 3 insertions(+), 2 deletions(-) > > diff --git a/spec/unit/util/network_device/transport/ssh_spec.rb > b/spec/unit/util/network_device/transport/ssh_spec.rb > index 18d22a9..60cf297 100755 > --- a/spec/unit/util/network_device/transport/ssh_spec.rb > +++ b/spec/unit/util/network_device/transport/ssh_spec.rb > @@ -2,9 +2,10 @@ > > require File.dirname(__FILE__) + '/../../../../spec_helper' > > -require 'puppet/util/network_device/transport/ssh' > +require 'puppet/util/network_device/transport/ssh' if Puppet.features.ssh?
If possible, it's better to have this included class do the feature testing - it's problematic if a given file throws exceptions if it's included. If the class in this file inherits from a required class, obviously you can't avoid this construct, but I'd far prefer to have the test for the feature happen in the initialize() method. > -describe Puppet::Util::NetworkDevice::Transport::Ssh, :if => > Puppet.features.ssh? do > +# Use a string as description because the class is unknown if features.ssh? > is false > +describe 'Puppet::Util::NetworkDevice::Transport::Ssh', :if => > Puppet.features.ssh? do > > before(:each) do > @transport = Puppet::Util::NetworkDevice::Transport::Ssh.new() > -- > 1.7.5.rc3 > > -- > 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. > -- The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. -- Joe Martin --------------------------------------------------------------------- Luke Kanies -|- http://puppetlabs.com -|- http://about.me/lak -- 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.
