Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dreier committed Dec 15, 2014
1 parent 356e3ee commit 64912b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,22 @@ describe 'example' do
end
```

In the real world, you probably don't want to iterate through all of the platforms, so `puppet_spec_facts` allows you to query a subset based on facter facts:
In the real world, you probably don't want to iterate through all of the
platforms, so `puppet_spec_facts` allows you to query a subset based on
facter facts:

```ruby
require 'spec_helper'

describe 'example' do
context 'all operating systems' do
PuppetSpecFacts.facts_for_platform_by_fact(select_facts: {'lsbdistid' => 'CentOS',
'architecture' => 'x86_64',
'is_pe' => 'true',
'fact_style' => 'stringified'}) do |name, facthash|
PuppetSpecFacts.facts_for_platform_by_fact(
select_facts: {
'lsbdistid' => 'CentOS',
'architecture' => 'x86_64',
'is_pe' => 'true',
'fact_style' => 'stringified'
}) do |name, facthash|
# This loads all fact sets for Puppet Enterprise on x86_64 CentOS with stringified-style facts
describe "example class without any parameters on #{name}" do
let(:params) {{ }}
Expand All @@ -84,3 +89,9 @@ describe 'example' do
end
end
```

In many cases, this will provide too many results. You can constrain the
results further by using the `select_facts` parameter to indicate the general
set, then the `unique_selector` parameter to only return one result for the
parameters specified in `unique_selector`. For example, you may wish to only get
one result per `operatingsystemrelease` fact, to avoid testing
2 changes: 1 addition & 1 deletion lib/puppet_spec_facts/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PuppetSpecFacts
VERSION = "0.1.0"
VERSION = "0.2.0"
end

0 comments on commit 64912b7

Please sign in to comment.