Skip to content

Commit 80820b6

Browse files
authored
Merge pull request #541 from scottatron/optional-fixtures-setup
Add 'setup_fixtures' configuration option
2 parents f10e962 + 6585414 commit 80820b6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ implementation. This should only be enabled if you're running into an issue
186186
running cross-platform tests where you have Ruby code (types, providers,
187187
functions, etc) that use `Pathname#absolute?`.
188188

189+
#### setup\_fixtures
190+
Type | Default | Puppet Version(s)
191+
------- | ------- | ---------------
192+
Boolean | `true` | 2.x, 3.x, 4.x
193+
194+
Configures rspec-puppet to automatically create a link from the root of your
195+
module to `spec/fixtures/<module name>` at the beginning of the test run.
196+
189197
## Naming conventions
190198

191199
For clarity and consistency, I recommend that you use the following directory

lib/rspec-puppet.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@
3838
c.add_setting :stringify_facts, :default => true
3939
c.add_setting :strict_variables, :default => false
4040
c.add_setting :adapter
41+
c.add_setting :setup_fixtures, :default => true
4142

4243
c.before(:all) do
43-
RSpec::Puppet::Setup.safe_setup_directories(nil, false)
44+
if RSpec.configuration.setup_fixtures?
45+
RSpec::Puppet::Setup.safe_setup_directories(nil, false)
46+
end
4447
end
4548

4649
if defined?(Puppet::Test::TestHelper)

0 commit comments

Comments
 (0)