summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-04-21 11:29:05 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-04-21 11:36:27 -0700
commitc3a76a98226866fe691d0c6cb3995ec08af799e5 (patch)
treef55a4f9acc1e1aa1854fd0993a998405520bf700 /lib
parent7bd6a2f37beda001c83b666900df436a33cfccb1 (diff)
(#7021) Fix order dependent spec failures
Running: rspec spec/unit/util/network_device_spec.rb spec/integration/transaction_spec.rb Caused Mocha::ExpectationError: unexpected invocation: #<Mock:device>.command() The NetworkDevice class had a current reader that once set, never got unset and lived between tests. Paired-with: Josh Cooper <josh@puppetlabs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/network_device.rb2
-rw-r--r--lib/puppet/util/network_device.rb7
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/puppet/provider/network_device.rb b/lib/puppet/provider/network_device.rb
index b178df977..46be27968 100644
--- a/lib/puppet/provider/network_device.rb
+++ b/lib/puppet/provider/network_device.rb
@@ -65,4 +65,4 @@ class Puppet::Provider::NetworkDevice < Puppet::Provider
def properties
@property_hash.dup
end
-end \ No newline at end of file
+end
diff --git a/lib/puppet/util/network_device.rb b/lib/puppet/util/network_device.rb
index d9c1aa34d..7fb8e2ff3 100644
--- a/lib/puppet/util/network_device.rb
+++ b/lib/puppet/util/network_device.rb
@@ -9,4 +9,9 @@ class Puppet::Util::NetworkDevice
rescue => detail
raise "Can't load #{device.provider} for #{device.name}: #{detail}"
end
-end \ No newline at end of file
+
+ # Should only be used in tests
+ def self.teardown
+ @current = nil
+ end
+end