annotate modules/firewall/spec/spec_helper.rb @ 218:4adfea407a15 puppet-3.6

Blacklist more bad usernames
author IBBoard <dev@ibboard.co.uk>
date Wed, 28 Aug 2019 17:25:36 +0100
parents d6f2a0ee45c0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
39
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 dir = File.expand_path(File.dirname(__FILE__))
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 $LOAD_PATH.unshift File.join(dir, 'lib')
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 # Don't want puppet getting the command line arguments for rake or autotest
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 ARGV.clear
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 require 'rubygems'
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 require 'bundler/setup'
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 require 'rspec-puppet'
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 Bundler.require :default, :test
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 require 'pathname'
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 require 'tmpdir'
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 Pathname.glob("#{dir}/shared_behaviours/**/*.rb") do |behaviour|
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 require behaviour.relative_path_from(Pathname.new(dir))
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 end
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 RSpec.configure do |config|
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 config.tty = true
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 config.mock_with :rspec do |c|
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 c.syntax = :expect
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 end
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 config.module_path = File.join(fixture_path, 'modules')
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 config.manifest_dir = File.join(fixture_path, 'manifests')
d6f2a0ee45c0 Add "Firewall" module
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 end