-
Notifications
You must be signed in to change notification settings - Fork 232
allows for 0 _ttl's without time signifier and enables tests #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,10 @@ | ||
| fixtures: | ||
| repositories: | ||
| 'inifile': "git://github.com/cprice-puppet/puppetlabs-inifile.git" | ||
| symlinks: | ||
| "puppetdb": "#{source_dir}" | ||
| repositories: | ||
| 'inifile' : 'git://github.com/cprice-puppet/puppetlabs-inifile.git' | ||
| 'stdlib' : 'git://github.com/puppetlabs/puppetlabs-stdlib.git' | ||
| 'postgresql': 'git://github.com/puppetlabs/puppet-postgresql.git' | ||
| 'firewall' : 'git://github.com/puppetlabs/puppetlabs-firewall.git' | ||
| 'apt' : 'git://github.com/puppetlabs/puppetlabs-apt.git' | ||
| 'concat' : 'git://github.com/ripienaar/puppet-concat.git' | ||
| symlinks: | ||
| 'puppetdb': '#{source_dir}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| source :rubygems | ||
|
|
||
| puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] | ||
| gem 'puppet', puppetversion | ||
| gem 'puppetlabs_spec_helper', '>= 0.1.0' | ||
| gem 'puppet-lint', '>= 0.3.2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| pkg/ | ||
| metadata.json | ||
| *.swp | ||
| .DS_Store | ||
| coverage/ | ||
| spec/fixtures/modules/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| language: ruby | ||
| before_script: "gem install --no-ri --no-rdoc bundler" | ||
| after_script: | ||
| script: "rake spec" | ||
| notifications: | ||
| email: false | ||
| rvm: | ||
| - 1.9.3 | ||
| - 1.8.7 | ||
| env: | ||
| - PUPPET_VERSION=2.6.9 | ||
| - PUPPET_VERSION=2.7.13 | ||
| - PUPPET_VERSION=3.1.1 | ||
| gemfile: .gemfile | ||
| matrix: | ||
| allow_failures: | ||
| - env: PUPPET_VERSION=2.6.9 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| require 'spec_helper' | ||
| describe 'puppetdb' do | ||
|
|
||
| ttl_args = ['node_ttl','node_purge_ttl','report_ttl'] | ||
|
|
||
| context 'on a supported platform' do | ||
| let(:facts) { { :osfamily => 'RedHat', | ||
| :postgres_default_version => '9.1', | ||
| :concat_basedir => '/var/lib/puppet/concat', | ||
| } } | ||
|
|
||
| describe 'when using default values for puppetdb class' do | ||
| it { | ||
| should contain_class('puppetdb') | ||
| } | ||
| end | ||
|
|
||
| ttl_args.each do |ttl_arg| | ||
| describe "when using 0 for #{ttl_arg} puppetdb class" do | ||
| it { | ||
| should contain_class('puppetdb') | ||
| } | ||
| describe "when using a capitalized time signifier for #{ttl_arg} for puppetdb class" do | ||
| it { | ||
| should contain_class('puppetdb') | ||
| } | ||
| end | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'with invalid arguments on a supported platform' do | ||
| let(:facts) { { :osfamily => 'RedHat', | ||
| :postgres_default_version => '9.1', | ||
| :concat_basedir => '/var/lib/puppet/concat', | ||
| } } | ||
| ttl_args.each do |ttl_arg| | ||
| let(:params) { { ttl_arg => 'invalid_value' } } | ||
| describe "when using a value that does not match the validation regex for #{ttl_arg} puppetdb class" do | ||
| it { | ||
| expect { | ||
| should contain_class('puppetdb') | ||
| }.to raise_error(Puppet::Error) | ||
| } | ||
| end | ||
| end | ||
| end | ||
| end | ||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| require 'rubygems' | ||
| require 'puppetlabs_spec_helper/module_spec_helper' |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't really test what you want to test, I'm removing it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kbarber
Lines 4-16 should be testing that if you just 'include puppetdb' and use all the defaults, that it should contain the puppetdb class, ie: not fail.
Is that the code to which you are referring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now - I mean the block referenced by line 18.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, that part need the :params hash set to use '0' for the ttl_args
The next part on line 23 should have the :params hash to set something like 1S (capital) which should still work since the code uses downcase()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - you'll need a new PR for that though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the insight and help.