diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-03-22 18:05:51 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-22 18:05:51 -0700 |
| commit | af79d3c63479a77278e174f370b4b3d156bec1a1 (patch) | |
| tree | d74761f560e41141b26918620f6fd6ee162028ab /spec/unit/interface | |
| parent | f7db67513cace1efaf054406dae040dab2c44efd (diff) | |
| download | puppet-af79d3c63479a77278e174f370b4b3d156bec1a1.tar.gz puppet-af79d3c63479a77278e174f370b4b3d156bec1a1.tar.xz puppet-af79d3c63479a77278e174f370b4b3d156bec1a1.zip | |
maint: Fix order-dependent spec failures
The specs for InterfaceCollection were clearing the list of interfaces at the
end of the spec run, which caused later specs to fail because they couldn't
re-require interfaces they needed. This fixes the InterfaceCollection specs to
save and restore the interfaces at the end of the file.
Reviewed-By: Matt Robinson
Diffstat (limited to 'spec/unit/interface')
| -rw-r--r-- | spec/unit/interface/interface_collection_spec.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/unit/interface/interface_collection_spec.rb b/spec/unit/interface/interface_collection_spec.rb index 536e694fd..42a0f2490 100644 --- a/spec/unit/interface/interface_collection_spec.rb +++ b/spec/unit/interface/interface_collection_spec.rb @@ -3,12 +3,18 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') require 'puppet/interface/interface_collection' describe Puppet::Interface::InterfaceCollection do + # This is global state that other tests depend on, so we have to save and + # restore it + before :all do + @saved_interfaces = subject.instance_variable_get("@interfaces").dup + end + before :each do subject.instance_variable_set("@interfaces", {}) end after :all do - subject.instance_variable_set("@interfaces", {}) + subject.instance_variable_set("@interfaces", @saved_interfaces) end describe "::interfaces" do |
