Skip to content

Commit

Permalink
Ran 'bundle exec rake rubocop:auto_correct'. Summary was '47 files in…
Browse files Browse the repository at this point in the history
…spected, 590 offenses detected, 544 offenses corrected' (voxpupuli#404).
  • Loading branch information
Ben Dalling committed Sep 26, 2017
1 parent af2e051 commit 69659fb
Show file tree
Hide file tree
Showing 31 changed files with 540 additions and 540 deletions.
2 changes: 1 addition & 1 deletion lib/facter/cassandrarelease.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
Facter.add('cassandrarelease') do
setcode do
version = Facter::Util::Resolution.exec('nodetool version')
version.match(/\d+\.\d+\.\d+/).to_s if version && version != ''
version.match(%r{\d+\.\d+\.\d+}).to_s if version && version != ''
end
end
20 changes: 10 additions & 10 deletions spec/acceptance/cassandra_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# firewall_pp = t.firewall_pp()
cassandra_install_pp = t.cassandra_install_pp

it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(cassandra_install_pp, catch_failures: true)
end

Expand All @@ -41,7 +41,7 @@
end

describe "Create schema for #{version}." do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.schema_create_pp, catch_failures: true)
end

Expand All @@ -53,7 +53,7 @@
end

describe "Schema drop type for #{version}." do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.schema_drop_type_pp, catch_failures: true)
end

Expand All @@ -63,7 +63,7 @@
end

describe "Revoke permissions for #{version}." do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.permissions_revoke_pp, catch_failures: true)
end

Expand All @@ -73,7 +73,7 @@
end

describe "Drop user for #{version}" do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.schema_drop_user_pp, catch_failures: true)
end

Expand All @@ -83,7 +83,7 @@
end

describe "Drop index for #{version}" do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.schema_drop_index_pp, catch_failures: true)
end

Expand All @@ -93,7 +93,7 @@
end

describe "Drop table for #{version}" do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.schema_drop_table_pp, catch_failures: true)
end

Expand All @@ -103,7 +103,7 @@
end

describe "Drop keyspace for #{version}" do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.schema_drop_keyspace_pp, catch_failures: true)
end

Expand All @@ -113,14 +113,14 @@
end

describe "Facts Tests for #{version}" do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.facts_testing_pp, catch_failures: true)
end
end

next unless version != 3.0
describe "Uninstall #{version}." do
it 'should work with no errors' do
it 'works with no errors' do
apply_manifest(t.cassandra_uninstall_pp, catch_failures: true)
end
end
Expand Down
18 changes: 9 additions & 9 deletions spec/classes/apache_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
end

it do
should have_resource_count(1)
is_expected.to have_resource_count(1)

should contain_class('cassandra::apache_repo').only_with(
is_expected.to contain_class('cassandra::apache_repo').only_with(
'descr' => 'Repo for Apache Cassandra',
'key_id' => 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA',
'key_url' => 'https://www.apache.org/dist/cassandra/KEYS',
'release' => '311x'
)

should contain_yumrepo('cassandra_apache').with(
is_expected.to contain_yumrepo('cassandra_apache').with(
ensure: 'present',
descr: 'Repo for Apache Cassandra',
baseurl: 'http://www.apache.org/dist/cassandra/redhat/311x',
Expand All @@ -53,23 +53,23 @@
end

it do
should have_resource_count(3)
should contain_class('apt')
should contain_class('apt::update')
is_expected.to have_resource_count(3)
is_expected.to contain_class('apt')
is_expected.to contain_class('apt::update')

should contain_apt__key('apache.cassandra').with(
is_expected.to contain_apt__key('apache.cassandra').with(
id: 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA',
source: 'https://www.apache.org/dist/cassandra/KEYS'
)

should contain_apt__source('cassandra.sources').with(
is_expected.to contain_apt__source('cassandra.sources').with(
location: 'http://www.apache.org/dist/cassandra/debian',
comment: 'Repo for Apache Cassandra',
release: 'main',
include: { 'src' => false }
).that_notifies('Exec[update-apache-cassandra-repo]')

should contain_exec('update-apache-cassandra-repo').with(
is_expected.to contain_exec('update-apache-cassandra-repo').with(
refreshonly: true,
command: '/bin/true'
)
Expand Down
20 changes: 10 additions & 10 deletions spec/classes/datastax_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
end

it do
should have_resource_count(4)
is_expected.to have_resource_count(4)

should contain_class('cassandra::datastax_agent').only_with(
is_expected.to contain_class('cassandra::datastax_agent').only_with(
'defaults_file' => '/etc/default/datastax-agent',
'package_ensure' => 'present',
'package_name' => 'datastax-agent',
Expand All @@ -35,27 +35,27 @@
'local_interface' => nil
)

should contain_package('datastax-agent').with(
is_expected.to contain_package('datastax-agent').with(
ensure: 'present',
notify: 'Exec[datastax_agent_reload_systemctl]'
).that_notifies('Exec[datastax_agent_reload_systemctl]')

should contain_exec('datastax_agent_reload_systemctl').only_with(
is_expected.to contain_exec('datastax_agent_reload_systemctl').only_with(
command: '/usr/bin/systemctl daemon-reload',
onlyif: 'test -x /usr/bin/systemctl',
path: ['/usr/bin', '/bin'],
refreshonly: true,
notify: 'Service[datastax-agent]'
).that_notifies('Service[datastax-agent]')

should contain_file('/var/lib/datastax-agent/conf/address.yaml')
.with(
is_expected.to contain_file('/var/lib/datastax-agent/conf/address.yaml').
with(
owner: 'cassandra',
group: 'cassandra',
mode: '0644'
).that_requires('Package[datastax-agent]')

should contain_service('datastax-agent').only_with(
is_expected.to contain_service('datastax-agent').only_with(
ensure: 'running',
enable: true,
name: 'datastax-agent'
Expand All @@ -72,7 +72,7 @@
end

it do
should contain_exec('datastax_agent_reload_systemctl').with(
is_expected.to contain_exec('datastax_agent_reload_systemctl').with(
command: '/bin/systemctl daemon-reload',
onlyif: 'test -x /bin/systemctl',
path: ['/usr/bin', '/bin'],
Expand All @@ -96,7 +96,7 @@
end

it do
should contain_ini_setting('java_home').with(
is_expected.to contain_ini_setting('java_home').with(
ensure: 'present',
path: '/etc/default/datastax-agent',
section: '',
Expand Down Expand Up @@ -134,7 +134,7 @@
end

it do
should have_resource_count(4)
is_expected.to have_resource_count(4)
end
end
end
18 changes: 9 additions & 9 deletions spec/classes/datastax_repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
end

it do
should have_resource_count(1)
is_expected.to have_resource_count(1)

should contain_class('cassandra::datastax_repo').only_with(
is_expected.to contain_class('cassandra::datastax_repo').only_with(
'descr' => 'DataStax Repo for Apache Cassandra',
'key_id' => '7E41C00F85BFC1706C4FFFB3350200F2B999A372',
'key_url' => 'http://debian.datastax.com/debian/repo_key',
'release' => 'stable'
)

should contain_yumrepo('datastax').with(
is_expected.to contain_yumrepo('datastax').with(
ensure: 'present',
descr: 'DataStax Repo for Apache Cassandra',
baseurl: 'http://rpm.datastax.com/community',
Expand All @@ -46,23 +46,23 @@
end

it do
should have_resource_count(3)
should contain_class('apt')
should contain_class('apt::update')
is_expected.to have_resource_count(3)
is_expected.to contain_class('apt')
is_expected.to contain_class('apt::update')

should contain_apt__key('datastaxkey').with(
is_expected.to contain_apt__key('datastaxkey').with(
id: '7E41C00F85BFC1706C4FFFB3350200F2B999A372',
source: 'http://debian.datastax.com/debian/repo_key'
)

should contain_apt__source('datastax').with(
is_expected.to contain_apt__source('datastax').with(
location: 'http://debian.datastax.com/community',
comment: 'DataStax Repo for Apache Cassandra',
release: 'stable',
include: { 'src' => false }
).that_notifies('Exec[update-cassandra-repos]')

should contain_exec('update-cassandra-repos').with(
is_expected.to contain_exec('update-cassandra-repos').with(
refreshonly: true,
command: '/bin/true'
)
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/dse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
end

it do
should have_resource_count(6)
should contain_class('cassandra')
is_expected.to have_resource_count(6)
is_expected.to contain_class('cassandra')

should contain_class('cassandra::dse').with(
is_expected.to contain_class('cassandra::dse').with(
config_file_mode: '0644',
config_file: '/etc/dse/dse.yaml'
)
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/firewall_ports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

context 'Run with defaults.' do
it do
should have_resource_count(2)
should contain_firewall('200 - Cassandra (Public) - 0.0.0.0/0')
is_expected.to have_resource_count(2)
is_expected.to contain_firewall('200 - Cassandra (Public) - 0.0.0.0/0')

should contain_class('cassandra::firewall_ports').with(
is_expected.to contain_class('cassandra::firewall_ports').with(
client_ports: [9042, 9160],
client_subnets: ['0.0.0.0/0'],
inter_node_ports: [7000, 7001, 7199],
Expand All @@ -24,7 +24,7 @@
opscenter_subnets: ['0.0.0.0/0']
)

should contain_cassandra__private__firewall_ports__rule('200_Public_0.0.0.0/0').with(ports: [8888, 22])
is_expected.to contain_cassandra__private__firewall_ports__rule('200_Public_0.0.0.0/0').with(ports: [8888, 22])
end
end
end
Loading

0 comments on commit 69659fb

Please sign in to comment.