Skip to content

Commit

Permalink
Merge pull request voxpupuli#89 from JAORMX/rename-rubocop
Browse files Browse the repository at this point in the history
Fix .rubocop.yml issues
  • Loading branch information
saz authored Jan 9, 2018
2 parents 5a690f7 + d5513da commit c9b5203
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 24 deletions.
12 changes: 9 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require: rubocop-rspec
AllCops:
TargetRubyVersion: 1.9
TargetRubyVersion: 2.1
Include:
- ./**/*.rb
Exclude:
Expand Down Expand Up @@ -163,6 +163,9 @@ Style/ClassAndModuleChildren:
Style/ClassCheck:
Enabled: true

Naming/HeredocDelimiterNaming:
Enabled: false

# Class length is not necessarily an indicator of code quality
Metrics/ClassLength:
Enabled: false
Expand Down Expand Up @@ -412,7 +415,7 @@ Style/NumericLiterals:
Style/OneLineConditional:
Enabled: true

Style/OpMethod:
Naming/BinaryOperatorParameterName:
Enabled: true

Style/ParenthesesAroundCondition:
Expand Down Expand Up @@ -516,5 +519,8 @@ RSpec/DescribeClass:
RSpec/ExampleLength:
Enabled: False

RSpec/NestedGroups:
RSpec/NestedGroups:
Max: 4

RSpec/MultipleExpectations:
Enabled: False
4 changes: 2 additions & 2 deletions lib/puppet/parser/functions/memcached_max_memory.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Puppet::Parser::Functions
newfunction(:memcached_max_memory, :type => :rvalue, :doc => <<-EOS
newfunction(:memcached_max_memory, :type => :rvalue, :doc => <<-ENDHEREDOC
Calculate max_memory size from fact 'memsize' and passed argument.
EOS
ENDHEREDOC
) do |arguments|

if arguments.size != 1
Expand Down
36 changes: 18 additions & 18 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
require 'spec_helper'
describe 'memcached' do
let :default_params do
{
package_ensure: 'present',
logfile: '/var/log/memcached.log',
lock_memory: false,
listen_ip: '127.0.0.1',
tcp_port: 11211,
udp_port: 11211,
user: 'nobody',
max_connections: 8192,
install_dev: false,
processorcount: 1,
use_sasl: false,
large_mem_pages: false,
pidfile: '/var/run/memcached.pid'
}
end

describe 'with manage_firewall parameter' do
%w[Debian RedHat].each do |osfam|
context "on osfamily #{osfam}" do
Expand Down Expand Up @@ -40,24 +58,6 @@
end
end

let :default_params do
{
package_ensure: 'present',
logfile: '/var/log/memcached.log',
lock_memory: false,
listen_ip: '127.0.0.1',
tcp_port: 11211,
udp_port: 11211,
user: 'nobody',
max_connections: 8192,
install_dev: false,
processorcount: 1,
use_sasl: false,
large_mem_pages: false,
pidfile: '/var/run/memcached.pid'
}
end

[{},
{
package_ensure: 'latest',
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.configure do |config|
config.hiera_config = 'spec/fixtures/hiera/hiera.yaml'
config.before :each do
config.before do
# Ensure that we don't accidentally cache facts and environment between
# test cases. This requires each example group to explicitly load the
# facts being exercised with something like
Expand Down

0 comments on commit c9b5203

Please sign in to comment.