~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to .pc/CVE-2011-3872.patch/spec/spec_helper.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dir = File.expand_path(File.dirname(__FILE__))
2
 
$LOAD_PATH.unshift File.join(dir, 'lib')
3
 
 
4
 
# Don't want puppet getting the command line arguments for rake or autotest
5
 
ARGV.clear
6
 
 
7
 
require 'puppet'
8
 
require 'mocha'
9
 
gem 'rspec', '>=2.0.0'
10
 
require 'rspec/expectations'
11
 
 
12
 
# So everyone else doesn't have to include this base constant.
13
 
module PuppetSpec
14
 
  FIXTURE_DIR = File.join(dir = File.expand_path(File.dirname(__FILE__)), "fixtures") unless defined?(FIXTURE_DIR)
15
 
end
16
 
 
17
 
require 'pathname'
18
 
require 'tmpdir'
19
 
 
20
 
require 'puppet_spec/verbose'
21
 
require 'puppet_spec/files'
22
 
require 'puppet_spec/fixtures'
23
 
require 'puppet_spec/matchers'
24
 
require 'monkey_patches/alias_should_to_must'
25
 
require 'monkey_patches/publicize_methods'
26
 
 
27
 
Pathname.glob("#{dir}/shared_behaviours/**/*.rb") do |behaviour|
28
 
  require behaviour.relative_path_from(Pathname.new(dir))
29
 
end
30
 
 
31
 
RSpec.configure do |config|
32
 
  include PuppetSpec::Fixtures
33
 
 
34
 
  config.mock_with :mocha
35
 
 
36
 
  config.before :each do
37
 
    GC.disable
38
 
 
39
 
    # these globals are set by Application
40
 
    $puppet_application_mode = nil
41
 
    $puppet_application_name = nil
42
 
 
43
 
    # REVISIT: I think this conceals other bad tests, but I don't have time to
44
 
    # fully diagnose those right now.  When you read this, please come tell me
45
 
    # I suck for letting this float. --daniel 2011-04-21
46
 
    Signal.stubs(:trap)
47
 
 
48
 
    # Set the confdir and vardir to gibberish so that tests
49
 
    # have to be correctly mocked.
50
 
    Puppet[:confdir] = "/dev/null"
51
 
    Puppet[:vardir] = "/dev/null"
52
 
 
53
 
    # Avoid opening ports to the outside world
54
 
    Puppet.settings[:bindaddress] = "127.0.0.1"
55
 
 
56
 
    @logs = []
57
 
    Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs))
58
 
 
59
 
    @log_level = Puppet::Util::Log.level
60
 
  end
61
 
 
62
 
  config.after :each do
63
 
    Puppet.settings.clear
64
 
    Puppet::Node::Environment.clear
65
 
    Puppet::Util::Storage.clear
66
 
    Puppet::Util::ExecutionStub.reset
67
 
 
68
 
    PuppetSpec::Files.cleanup
69
 
 
70
 
    @logs.clear
71
 
    Puppet::Util::Log.close_all
72
 
    Puppet::Util::Log.level = @log_level
73
 
 
74
 
    GC.enable
75
 
  end
76
 
end