diff options
| author | Nick Lewis <nick@puppetlabs.com> | 2011-03-22 18:12:06 -0700 |
|---|---|---|
| committer | Nick Lewis <nick@puppetlabs.com> | 2011-03-22 18:12:06 -0700 |
| commit | 6dd629cb79e56d0bbf4670b84a73b0a7e3eef919 (patch) | |
| tree | d74761f560e41141b26918620f6fd6ee162028ab | |
| parent | f7db67513cace1efaf054406dae040dab2c44efd (diff) | |
| parent | af79d3c63479a77278e174f370b4b3d156bec1a1 (diff) | |
| download | puppet-6dd629cb79e56d0bbf4670b84a73b0a7e3eef919.tar.gz puppet-6dd629cb79e56d0bbf4670b84a73b0a7e3eef919.tar.xz puppet-6dd629cb79e56d0bbf4670b84a73b0a7e3eef919.zip | |
Merge branch 'maint/master/fix-order-dependent-spec-failures'
| -rw-r--r-- | spec/unit/application/interface_base_spec.rb | 9 | ||||
| -rw-r--r-- | spec/unit/interface/interface_collection_spec.rb | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/spec/unit/application/interface_base_spec.rb b/spec/unit/application/interface_base_spec.rb index 3e7c04f5c..0df030846 100644 --- a/spec/unit/application/interface_base_spec.rb +++ b/spec/unit/application/interface_base_spec.rb @@ -2,13 +2,12 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb') require 'puppet/application/interface_base' -require 'puppet/application/interface_base' - -base_interface = Puppet::Interface.interface(:basetest) -class Puppet::Application::InterfaceBase::Basetest < Puppet::Application::InterfaceBase -end describe Puppet::Application::InterfaceBase do + base_interface = Puppet::Interface.interface(:basetest) + class Puppet::Application::InterfaceBase::Basetest < Puppet::Application::InterfaceBase + end + before do @app = Puppet::Application::InterfaceBase::Basetest.new @app.stubs(:interface).returns base_interface 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 |
