Sha256: 6835f442e8ab778ecafc95ba5d022a028f98833913a02ddf9efd4143057c9961
Contents?: true
Size: 1.88 KB
Versions: 28
Compression:
Stored size: 1.88 KB
Contents
require "#{File.dirname(__FILE__)}/../../../test_helper" include_fixture_resources class ExecResourceTest < Test::Unit::TestCase context "Base" do setup do PoolParty::Resource.define_resource_methods @res = PoolParty::Resources::Exec.new "/usr/sbin/mail -s 'hi' arilerner@mac.com" @base = DependencyResolvers::Chef @base.compile_directory = test_dir @str = <<-EOE execute "/usr/sbin/mail -s 'hi' arilerner@mac.com" do command "/usr/sbin/mail -s 'hi' arilerner@mac.com" path [ "/usr/bin:/bin:/usr/local/bin:$PATH" ] action :run EOE end should "have the method denoted by has_method_name turn into the string without any modifications" do assert_equal "#{@str}end".chomp, @res.compile(:chef) end should "have the creates method when it's set" do @res.creates = "/etc/poolparty/created" @str << ' creates "/etc/poolparty/created"' assert_equal "#{@str}\nend", @res.compile(:chef) end should "have the cwd method when it's set" do @res.cwd = "/var/poolparty" @str << ' cwd "/var/poolparty"' assert_equal "#{@str}\nend", @res.compile(:chef) end should "have the environment method when it's set" do @res.environment = :development @str << ' environment :development' assert_equal "#{@str}\nend", @res.compile(:chef) end should "have the group method when it's set" do @res.group = 501 @str << ' group 501' assert_equal "#{@str}\nend", @res.compile(:chef) end should "have the returns method when it's set" do @res.returns = 1 @str << ' returns 1' assert_equal "#{@str}\nend", @res.compile(:chef) end should "have the user method when it's set" do @res.user = 502 @str << ' user 502' assert_equal "#{@str}\nend", @res.compile(:chef) end end end
Version data entries
28 entries across 28 versions & 3 rubygems