Sha256: 74b1bfcea12485b7c988ca172e5bf015d1edd8c3f2f513f52f94f6f8723c8c87

Contents?: true

Size: 995 Bytes

Versions: 28

Compression:

Stored size: 995 Bytes

Contents

require "#{File.dirname(__FILE__)}/../../../../test_helper"

include_fixture_resources
include_chef_only_resources

class ScriptResourceTest < Test::Unit::TestCase
  context "Base" do
    setup do
      PoolParty::Resource.define_resource_methods
      @res = PoolParty::Resources::Script.new "install_something" do
        interpreter "bash"
        user "root"
        cwd "/tmp"
        code <<-EOH 
wget http://www.example.com/tarball.tar.gz
tar -zxf tarball.tar.gz
cd tarball
./configure
make
make install
EOH
      end
      @res.does_not_exist!
      @base = DependencyResolvers::Chef
      @base.compile_directory = test_dir
    end
    
    should "have the route print to chef" do
      str =<<-EOS
script "install_something" do
  code "wget http://www.example.com/tarball.tar.gz
tar -zxf tarball.tar.gz
cd tarball
./configure
make
make install
"
  interpreter "bash"
  cwd "/tmp"
  user "root"
end
      EOS

      assert_equal str.chomp, @base.compile(@res)
    end
    
  end
  
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
auser-poolparty-1.3.0 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.1 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.10 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.11 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.12 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.13 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.14 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.15 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.16 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.17 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.2 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.3 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.4 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.5 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.6 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.7 test/lib/dependency_resolvers/chef/resources/script_test.rb
auser-poolparty-1.3.8 test/lib/dependency_resolvers/chef/resources/script_test.rb
fairchild-poolparty-1.3.17 test/lib/dependency_resolvers/chef/resources/script_test.rb
fairchild-poolparty-1.3.5 test/lib/dependency_resolvers/chef/resources/script_test.rb
poolparty-1.3.15 test/lib/dependency_resolvers/chef/resources/script_test.rb