voxpupuli / puppet-nodejs

Puppet module to install nodejs and global npm packages
https://forge.puppet.com/puppet/nodejs
Apache License 2.0
113 stars 247 forks source link

modulesync & cleanup #240

Closed bastelfreak closed 8 years ago

igalic commented 8 years ago

sudden realization: the only way we can "release" modulesync_config 1.x is when rubocop becomes "stable" — or else every release would be a major version bump

bastelfreak commented 8 years ago

There weren't that many new things in the last rubocop releases. Our config was just very lax for a very long time. Fixing cops in the future will be way easier when our current config is already applied to a module.


Anybody has suggestions for the travis failures?

bbriggs commented 8 years ago

Best explanation I've seen so far on stubs/doubles: https://relishapp.com/rspec/rspec-mocks/v/3-2/docs/verifying-doubles/using-an-instance-double

bbriggs commented 8 years ago

Whatever object is being tested in [57,58,65] needs to be initialized as an instance double, then tested using more normal spec language. Example:

require 'unit_helper'

require 'user'

RSpec.describe User, '#suspend!' do
  it 'notifies the console' do
    notifier = instance_double("ConsoleNotifier")

    expect(notifier).to receive(:notify).with("suspended as")

    user = User.new(notifier)
    user.suspend!
  end
end
bastelfreak commented 8 years ago

I still have no idea how we should handle these rubocop errors. Can anybody provide some guidance?

igalic commented 8 years ago

my reccomendation is to open an issue directly in https://github.com/bbatsov/ruby-style-guide

petems commented 8 years ago

@bastelfreak I can do some fixing, had a similar rubocop stubbing issue with another module, tag me to remind me if I haven't opened a PR in a few days 👍

petems commented 8 years ago

Ok, I looked at the thing, turns out I'm not sure how to fix it...

Should we just put a control comment for the stubs and merge for now?

bastelfreak commented 8 years ago

+1000. I will do that after lunch

igalic commented 8 years ago

thanks everyone!