Duh, fixing all of the paths being loaded for spec in the moved tests.

This commit is contained in:
Luke Kanies 2008-05-15 19:34:21 -05:00
Родитель d02334f114
Коммит ac79a79c8d
19 изменённых файлов: 54 добавлений и 44 удалений

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/package'

Просмотреть файл

@ -3,7 +3,7 @@
# Created by Luke Kanies on 2007-11-20.
# Copyright (c) 2006. All rights reserved.
require File.dirname(__FILE__) + '/../../../../spec_helper'
require File.dirname(__FILE__) + '/../../../spec_helper'
provider_class = Puppet::Type.type(:interface).provider(:redhat)

Просмотреть файл

@ -3,7 +3,7 @@
# Created by Luke Kanies on 2007-11-25.
# Copyright (c) 2006. All rights reserved.
require File.dirname(__FILE__) + '/../../../../spec_helper'
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppet/provider/interface/sunos'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/provider/mount'

Просмотреть файл

@ -3,7 +3,7 @@
# Created by Luke Kanies on 2007-9-12.
# Copyright (c) 2006. All rights reserved.
require File.dirname(__FILE__) + '/../../../../spec_helper'
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppettest/support/utils'
require 'puppettest/fileparsing'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../../spec_helper'
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppettest'
require 'puppettest/support/utils'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/../spec_helper'
describe Puppet::Type, " when in a configuration" do
before do

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/exec'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Type.type(:file) do
before do

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
interface = Puppet::Type.type(:interface)

Просмотреть файл

@ -1,77 +1,75 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/mount'
describe Puppet::Type::Mount do
describe Puppet::Type.type(:mount) do
it "should have a :refreshable feature that requires the :remount method" do
Puppet::Type::Mount.provider_feature(:refreshable).methods.should == [:remount]
Puppet::Type.type(:mount).provider_feature(:refreshable).methods.should == [:remount]
end
it "should have no default value for :ensure" do
mount = Puppet::Type::Mount.create(:name => "yay")
mount = Puppet::Type.type(:mount).create(:name => "yay")
mount.should(:ensure).should be_nil
end
after { Puppet::Type::Mount.clear }
after { Puppet::Type.type(:mount).clear }
end
describe Puppet::Type::Mount, "when validating attributes" do
describe Puppet::Type.type(:mount), "when validating attributes" do
[:name, :remounts].each do |param|
it "should have a #{param} parameter" do
Puppet::Type::Mount.attrtype(param).should == :param
Puppet::Type.type(:mount).attrtype(param).should == :param
end
end
[:ensure, :device, :blockdevice, :fstype, :options, :pass, :dump, :atboot, :target].each do |param|
it "should have a #{param} property" do
Puppet::Type::Mount.attrtype(param).should == :property
Puppet::Type.type(:mount).attrtype(param).should == :property
end
end
end
describe Puppet::Type::Mount::Ensure, "when validating values" do
describe Puppet::Type.type(:mount)::Ensure, "when validating values" do
before do
@provider = stub 'provider', :class => Puppet::Type::Mount.defaultprovider, :clear => nil
Puppet::Type::Mount.defaultprovider.expects(:new).returns(@provider)
@provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil
Puppet::Type.type(:mount).defaultprovider.expects(:new).returns(@provider)
end
it "should support :present as a value to :ensure" do
Puppet::Type::Mount.create(:name => "yay", :ensure => :present)
Puppet::Type.type(:mount).create(:name => "yay", :ensure => :present)
end
it "should alias :unmounted to :present as a value to :ensure" do
mount = Puppet::Type::Mount.create(:name => "yay", :ensure => :unmounted)
mount = Puppet::Type.type(:mount).create(:name => "yay", :ensure => :unmounted)
mount.should(:ensure).should == :present
end
it "should support :absent as a value to :ensure" do
Puppet::Type::Mount.create(:name => "yay", :ensure => :absent)
Puppet::Type.type(:mount).create(:name => "yay", :ensure => :absent)
end
it "should support :mounted as a value to :ensure" do
Puppet::Type::Mount.create(:name => "yay", :ensure => :mounted)
Puppet::Type.type(:mount).create(:name => "yay", :ensure => :mounted)
end
after { Puppet::Type::Mount.clear }
after { Puppet::Type.type(:mount).clear }
end
describe Puppet::Type::Mount::Ensure do
describe Puppet::Type.type(:mount)::Ensure do
before :each do
@provider = stub 'provider', :class => Puppet::Type::Mount.defaultprovider, :clear => nil, :satisfies? => true, :name => :mock
Puppet::Type::Mount.defaultprovider.stubs(:new).returns(@provider)
@mount = Puppet::Type::Mount.create(:name => "yay", :check => :ensure)
@provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil, :satisfies? => true, :name => :mock
Puppet::Type.type(:mount).defaultprovider.stubs(:new).returns(@provider)
@mount = Puppet::Type.type(:mount).create(:name => "yay", :check => :ensure)
@ensure = @mount.property(:ensure)
end
after :each do
Puppet::Type::Mount.clear
Puppet::Type.type(:mount).clear
end
def mount_stub(params)
Puppet::Type::Mount.validproperties.each do |prop|
Puppet::Type.type(:mount).validproperties.each do |prop|
unless params[prop]
params[prop] = :absent
@mount[prop] = :absent
@ -83,7 +81,7 @@ describe Puppet::Type::Mount::Ensure do
end
end
describe Puppet::Type::Mount::Ensure, "when retrieving its current state" do
describe Puppet::Type.type(:mount)::Ensure, "when retrieving its current state" do
it "should return the provider's value if it is :absent" do
@provider.expects(:ensure).returns(:absent)
@ -103,7 +101,7 @@ describe Puppet::Type::Mount::Ensure do
end
end
describe Puppet::Type::Mount::Ensure, "when changing the host" do
describe Puppet::Type.type(:mount)::Ensure, "when changing the host" do
it "should destroy itself if it should be absent" do
@provider.stubs(:mounted?).returns(false)
@ -166,7 +164,7 @@ describe Puppet::Type::Mount::Ensure do
end
end
describe Puppet::Type::Mount, "when responding to events" do
describe Puppet::Type.type(:mount), "when responding to events" do
it "should remount if it is currently mounted" do
@provider.expects(:mounted?).returns(true)

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/external/nagios'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/metatype/metaparams'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/package'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/schedule'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/type/service'

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
ssh_authorized_key = Puppet::Type.type(:ssh_authorized_key)

Просмотреть файл

@ -1,6 +1,6 @@
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../../../spec_helper'
require File.dirname(__FILE__) + '/../../spec_helper'
module UserTestFunctions
def mkuser(name)

Просмотреть файл

@ -82,6 +82,18 @@ class TestProvider < Test::Unit::TestCase
assert(! provider.suitable?)
end
# #1197 - the binary should not be
def test_command_checks_for_binaries_each_time
provider = newprovider
provider.commands :testing => "/no/such/path"
provider.expects(:binary).returns "/no/such/path"
provider.command(:testing)
assert_equal("/no/such/path", provider.command(:testing), "Did not return correct binary path")
end
def test_command
{:echo => "echo", :echo_with_path => echo, :missing => "nosuchcommand", :missing_qualified => "/path/to/nosuchcommand"}.each do |name, command|
provider = newprovider