Skip to content
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

Chefspec 3.1 #28

Merged
merged 5 commits into from
Feb 1, 2014
Merged

Chefspec 3.1 #28

merged 5 commits into from
Feb 1, 2014

Conversation

kampfschlaefer
Copy link
Contributor

I am trying to write some more tests for munin. But munin only makes sense with a lot of searching and real results. So it would be fun to use chef-solo with chefspec for munin. Which in turn requires upcoming chefspec3.1.

So lets make this cookbook depend on chefspec3.1.0.beta.1.

Oh, and set the auth-method to htpasswd so the cookbook converges without throwing an error because of missing openid-stuff.

@kampfschlaefer
Copy link
Contributor Author

COOK-4120 in tickets.opscode.com

@@ -12,11 +12,11 @@
expect(template).to be
expect(template.source).to eq('munin-node.conf.erb')
expect(template.mode).to eq('0644')
expect(template).to notify('service[munin-node]', :restart)
notify('service[munin-node]').to(:restart)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a test - you want:

expect(template).to notify('service[munin-node]').to(:restart)

This whole test should read:

expect(chef_run).to create_template('/etc/munin/munin-node.conf').with(
  source: 'munin-node.conf.erb',
  mode: '0644',
)

template = chef_run.template('/etc/munin/munin-node.conf')
expect(template).to notify('service[munin-node]').to(:restart)

 - depend on chefspec ~>3.1 instead of ~>3.1.0
 - simplify the preparation of the runner in server_spec.rb
 - linebreaks for server_spec.rb
 - improve the template and service tests in client_spec.rb
@kampfschlaefer
Copy link
Contributor Author

This could be better?

@jesseadams
Copy link
Owner

@kampfschlaefer - Thanks for your work on this. Can you please fix the error?

@jesseadams
Copy link
Owner

@sethvargo - Thanks for the comments

@kampfschlaefer
Copy link
Contributor Author

@jesseadams I would love to fix the error. If I could reproduce it (did a bundle install directly before):

arnold@orinoco:~/chef-bcs/cookbooks/cookbook-munin$ bundle exec rubocop
Inspecting 11 files
...........

11 files inspected, no offences detected
arnold@orinoco:~/chef-bcs/cookbooks/cookbook-munin$ rbenv versions
  system
* 1.9.3-p448 (set by /home/arnold/chef-bcs/.ruby-version)
  2.0.0-p247
arnold@orinoco:~/chef-bcs/cookbooks/cookbook-munin$

@btm
Copy link
Collaborator

btm commented Jan 30, 2014

It looks like this is an issue with rubocop v0.16.0 and rainbow v2.0.0 and is now fixed in rubocop v0.18.0, released today.

rubocop/rubocop#762

@jesseadams
Copy link
Owner

Thanks for the heads up @btm. Will try that out here in a bit.

@btm
Copy link
Collaborator

btm commented Jan 30, 2014

I had Travis re-run the build and it's passing now.

jesseadams added a commit that referenced this pull request Feb 1, 2014
@jesseadams jesseadams merged commit 563394b into jesseadams:master Feb 1, 2014
@kampfschlaefer kampfschlaefer deleted the chefspec-3.1 branch February 4, 2014 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants