summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-30 18:23:40 -0600
committerLuke Kanies <luke@madstop.com>2008-12-30 18:23:40 -0600
commit16ff58b7fbb12ab1b927414823c387c7e04fad08 (patch)
tree3f8994d5800049a2a2142cd38763f9bdbf8e86cd
parentd2d3de5884a66f529101854a42ac52be83cde446 (diff)
parent3b8a77dfd97774c21156efb1553f3a5a0372c7fa (diff)
downloadpuppet-16ff58b7fbb12ab1b927414823c387c7e04fad08.tar.gz
puppet-16ff58b7fbb12ab1b927414823c387c7e04fad08.tar.xz
puppet-16ff58b7fbb12ab1b927414823c387c7e04fad08.zip
Merge commit 'masterzen/tickets/1834'
-rwxr-xr-xspec/integration/indirector/direct_file_server.rb3
-rwxr-xr-xspec/integration/indirector/module_files.rb3
-rwxr-xr-xspec/integration/type/file.rb3
-rwxr-xr-xspec/integration/type/tidy.rb3
-rwxr-xr-xspec/integration/util/settings.rb3
-rw-r--r--spec/shared_behaviours/file_server_terminus.rb3
-rwxr-xr-xspec/unit/parser/collector.rb4
-rwxr-xr-xspec/unit/parser/compiler.rb1
-rwxr-xr-xspec/unit/rails.rb4
-rwxr-xr-xspec/unit/type/file.rb3
10 files changed, 19 insertions, 11 deletions
diff --git a/spec/integration/indirector/direct_file_server.rb b/spec/integration/indirector/direct_file_server.rb
index c379bcbb7..1f1ea0dcc 100755
--- a/spec/integration/indirector/direct_file_server.rb
+++ b/spec/integration/indirector/direct_file_server.rb
@@ -38,8 +38,9 @@ describe Puppet::Indirector::DirectFileServer, " when interacting with FileServi
@terminus = Puppet::Indirector::FileContent::File.new
@path = Tempfile.new("direct_file_server_testing")
+ path = @path.path
@path.close!
- @path = @path.path
+ @path = path
Dir.mkdir(@path)
File.open(File.join(@path, "one"), "w") { |f| f.print "one content" }
diff --git a/spec/integration/indirector/module_files.rb b/spec/integration/indirector/module_files.rb
index a54588ec5..a474b7513 100755
--- a/spec/integration/indirector/module_files.rb
+++ b/spec/integration/indirector/module_files.rb
@@ -32,8 +32,9 @@ describe Puppet::Indirector::ModuleFiles, " when interacting with FileServing::F
@terminus = Puppet::Indirector::FileContent::Modules.new
@path = Tempfile.new("module_file_testing")
+ path = @path.path
@path.close!
- @path = @path.path
+ @path = path
Dir.mkdir(@path)
Dir.mkdir(File.join(@path, "files"))
diff --git a/spec/integration/type/file.rb b/spec/integration/type/file.rb
index 8e31bbb24..87a478d54 100755
--- a/spec/integration/type/file.rb
+++ b/spec/integration/type/file.rb
@@ -5,8 +5,9 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Type.type(:file) do
def tmpfile(name)
source = Tempfile.new(name)
+ path = source.path
source.close!
- source.path
+ path
end
describe "when recursing" do
diff --git a/spec/integration/type/tidy.rb b/spec/integration/type/tidy.rb
index 5916d88e5..50ec3d7a6 100755
--- a/spec/integration/type/tidy.rb
+++ b/spec/integration/type/tidy.rb
@@ -5,8 +5,9 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Type.type(:tidy) do
def tmpfile(name)
source = Tempfile.new(name)
+ path = source.path
source.close!
- source.path
+ path
end
# Testing #355.
diff --git a/spec/integration/util/settings.rb b/spec/integration/util/settings.rb
index a78046462..d2fe86892 100755
--- a/spec/integration/util/settings.rb
+++ b/spec/integration/util/settings.rb
@@ -5,8 +5,9 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Util::Settings do
def tmpfile(name)
source = Tempfile.new(name)
+ path = source.path
source.close!
- source.path
+ path
end
it "should be able to make needed directories" do
diff --git a/spec/shared_behaviours/file_server_terminus.rb b/spec/shared_behaviours/file_server_terminus.rb
index 13561f09c..1db6cfa0e 100644
--- a/spec/shared_behaviours/file_server_terminus.rb
+++ b/spec/shared_behaviours/file_server_terminus.rb
@@ -12,8 +12,9 @@ describe "Puppet::Indirector::FileServerTerminus", :shared => true do
FileTest.stubs(:exists?).with(Puppet[:fileserverconfig]).returns(true)
@path = Tempfile.new("file_server_testing")
+ path = @path.path
@path.close!
- @path = @path.path
+ @path = path
Dir.mkdir(@path)
File.open(File.join(@path, "myfile"), "w") { |f| f.print "my content" }
diff --git a/spec/unit/parser/collector.rb b/spec/unit/parser/collector.rb
index ede583b96..edd74e25f 100755
--- a/spec/unit/parser/collector.rb
+++ b/spec/unit/parser/collector.rb
@@ -194,7 +194,7 @@ describe Puppet::Parser::Collector, "when collecting virtual resources" do
end
describe Puppet::Parser::Collector, "when collecting exported resources" do
- confine Puppet.features.rails? => "Cannot test Rails integration without ActiveRecord"
+ confine "Cannot test Rails integration without ActiveRecord" => Puppet.features.rails?
before do
@scope = stub 'scope', :host => "myhost", :debug => nil
@@ -364,7 +364,7 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do
end
describe Puppet::Parser::Collector, "when building its ActiveRecord query for collecting exported resources" do
- confine Puppet.features.rails? => "Cannot test Rails integration without ActiveRecord"
+ confine "Cannot test Rails integration without ActiveRecord" => Puppet.features.rails?
before do
@scope = stub 'scope', :host => "myhost", :debug => nil
diff --git a/spec/unit/parser/compiler.rb b/spec/unit/parser/compiler.rb
index 203105289..f36b6fd4f 100755
--- a/spec/unit/parser/compiler.rb
+++ b/spec/unit/parser/compiler.rb
@@ -478,6 +478,7 @@ describe Puppet::Parser::Compiler do
end
describe Puppet::Parser::Compiler, "when storing compiled resources" do
+ confine "Cannot test Rails integration without ActiveRecord" => Puppet.features.rails?
it "should store the resources" do
Puppet.features.expects(:rails?).returns(true)
diff --git a/spec/unit/rails.rb b/spec/unit/rails.rb
index 533236772..f0ba2b942 100755
--- a/spec/unit/rails.rb
+++ b/spec/unit/rails.rb
@@ -66,7 +66,7 @@ describe Puppet::Rails, "when initializing any connection" do
end
describe Puppet::Rails, "when initializing a sqlite3 connection" do
- confine Puppet.features.rails? => "Cannot test without ActiveRecord"
+ confine "Cannot test without ActiveRecord" => Puppet.features.rails?
it "should provide the adapter, log_level, and dbfile arguments" do
Puppet.settings.expects(:value).with(:dbadapter).returns("sqlite3")
@@ -82,7 +82,7 @@ describe Puppet::Rails, "when initializing a sqlite3 connection" do
end
describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
- confine Puppet.features.rails? => "Cannot test without ActiveRecord"
+ confine "Cannot test without ActiveRecord" => Puppet.features.rails?
it "should provide the adapter, log_level, and host, username, password, and database arguments" do
Puppet.settings.stubs(:value).with(:dbadapter).returns("mysql")
diff --git a/spec/unit/type/file.rb b/spec/unit/type/file.rb
index 631284e3b..1bd049b5f 100755
--- a/spec/unit/type/file.rb
+++ b/spec/unit/type/file.rb
@@ -5,8 +5,9 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Type.type(:file) do
before do
@path = Tempfile.new("puppetspec")
+ pathname = @path.path
@path.close!()
- @path = @path.path
+ @path = pathname
@file = Puppet::Type::File.new(:name => @path)
@catalog = mock 'catalog'