summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-02 19:41:17 -0500
committerLuke Kanies <luke@madstop.com>2009-04-02 19:41:17 -0500
commita677e26eb1452c08d7724047a18e50f4a654d2cd (patch)
tree1a615f93e0504527db08ff29bd71e7d754228747 /spec/unit
parente016307f00fe67dc53f8581f08c1dfb5ab7dfb3b (diff)
downloadpuppet-a677e26eb1452c08d7724047a18e50f4a654d2cd.tar.gz
puppet-a677e26eb1452c08d7724047a18e50f4a654d2cd.tar.xz
puppet-a677e26eb1452c08d7724047a18e50f4a654d2cd.zip
Fixing all tests that were apparently broken in the 0.24.x merge.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/provider/augeas/augeas.rb1
-rwxr-xr-xspec/unit/transaction.rb2
-rwxr-xr-xspec/unit/type/tidy.rb11
-rw-r--r--spec/unit/util/selinux.rb5
4 files changed, 8 insertions, 11 deletions
diff --git a/spec/unit/provider/augeas/augeas.rb b/spec/unit/provider/augeas/augeas.rb
index 284145657..43fca723c 100644
--- a/spec/unit/provider/augeas/augeas.rb
+++ b/spec/unit/provider/augeas/augeas.rb
@@ -209,6 +209,7 @@ describe provider_class do
augeas_stub = stub("augeas", :match => ["set", "of", "values"])
augeas_stub.stubs("close")
provider = provider_class.new(resource)
+ provider.aug= augeas_stub
provider.stubs(:get_augeas_version).returns("0.3.5")
provider.need_to_run?.should == true
end
diff --git a/spec/unit/transaction.rb b/spec/unit/transaction.rb
index efd071231..60705c7fb 100755
--- a/spec/unit/transaction.rb
+++ b/spec/unit/transaction.rb
@@ -6,7 +6,7 @@ require 'puppet/transaction'
describe Puppet::Transaction do
it "should match resources by name, not title, when prefetching" do
- @catalog = Puppet::Node::Catalog.new
+ @catalog = Puppet::Resource::Catalog.new
@transaction = Puppet::Transaction.new(@catalog)
# Have both a title and name
diff --git a/spec/unit/type/tidy.rb b/spec/unit/type/tidy.rb
index e17f65de4..cf244ca0e 100755
--- a/spec/unit/type/tidy.rb
+++ b/spec/unit/type/tidy.rb
@@ -10,19 +10,12 @@ describe tidy do
end
it "should use :lstat when stating a file" do
- tidy = Puppet::Type.type(:tidy).new :path => "/foo/bar", :age => "1d"
+ resource = tidy.new :path => "/foo/bar", :age => "1d"
stat = mock 'stat'
File.expects(:lstat).with("/foo/bar").returns stat
- tidy.stat("/foo/bar").should == stat
+ resource.stat("/foo/bar").should == stat
end
- it "should be in sync if the targeted file does not exist" do
- File.expects(:lstat).with("/tmp/foonesslaters").raises Errno::ENOENT
- @tidy = tidy.create :path => "/tmp/foonesslaters", :age => "100d"
-
- @tidy.property(:ensure).must be_insync({})
- end
-
[:age, :size, :path, :matches, :type, :recurse, :rmdirs].each do |param|
it "should have a %s parameter" % param do
Puppet::Type.type(:tidy).attrclass(param).ancestors.should be_include(Puppet::Parameter)
diff --git a/spec/unit/util/selinux.rb b/spec/unit/util/selinux.rb
index dacf9f503..db3ee413a 100644
--- a/spec/unit/util/selinux.rb
+++ b/spec/unit/util/selinux.rb
@@ -31,7 +31,10 @@ describe Puppet::Util::SELinux do
describe "filesystem detection" do
before :each do
- File.expects(:read).with("/proc/mounts").returns "rootfs / rootfs rw 0 0\n/dev/root / ext3 rw,relatime,errors=continue,user_xattr,acl,data=ordered 0 0\n/dev /dev tmpfs rw,relatime,mode=755 0 0\n/proc /proc proc rw,relatime 0 0\n/sys /sys sysfs rw,relatime 0 0\n192.168.1.1:/var/export /mnt/nfs nfs rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nointr,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.1,mountvers=3,mountproto=udp,addr=192.168.1.1 0 0\n"
+ fh = stub 'fh', :close => nil
+ File.stubs(:open).with("/proc/mounts", File::NONBLOCK).returns fh
+ fh.stubs(:read).returns "rootfs / rootfs rw 0 0\n/dev/root / ext3 rw,relatime,errors=continue,user_xattr,acl,data=ordered 0 0\n/dev /dev tmpfs rw,relatime,mode=755 0 0\n/proc /proc proc rw,relatime 0 0\n/sys /sys sysfs rw,relatime 0 0\n192.168.1.1:/var/export /mnt/nfs nfs rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,nointr,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.1.1,mountvers=3,mountproto=udp,addr=192.168.1.1 0 0\n"
+ fh.stubs(:close)
end
it "should parse the contents of /proc/mounts" do