Skip to content

Commit

Permalink
autocorrect a few rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Fitzgerald committed May 20, 2014
1 parent ba02b8c commit 38ce87a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ end
desc 'Run RSpec unit tests'
RSpec::Core::RakeTask.new(:spec)

task :default => [ :cane, :rubocop, :loc, :spec ]
task default: [:cane, :rubocop, :loc, :spec]

# vim: ai et ts=2 sts=2 sw=2 ft=ruby fdm=marker
2 changes: 1 addition & 1 deletion kitchen-digitalocean.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/test-kitchen/kitchen-digitalocean'
spec.license = 'Apache 2.0'

spec.files = `git ls-files`.split($/)
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']
Expand Down
74 changes: 37 additions & 37 deletions spec/kitchen/driver/digitalocean_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@

let(:instance) do
double(
:name => 'potatoes',
:logger => logger,
:to_str => 'instance',
:platform => double(:name => platform_name)
name: 'potatoes',
logger: logger,
to_str: 'instance',
platform: double(name: platform_name)
)
end

Expand Down Expand Up @@ -101,14 +101,14 @@

context 'overridden options' do
config = {
:image_id => '22',
:flavor_id => '63',
:ssh_key_ids => '5678',
:username => 'admin',
:port => '2222',
:server_name => 'puppy',
:region_id => '1',
:flavor => '1GB'
image_id: '22',
flavor_id: '63',
ssh_key_ids: '5678',
username: 'admin',
port: '2222',
server_name: 'puppy',
region_id: '1',
flavor: '1GB'
}

let(:config) { config }
Expand All @@ -123,8 +123,8 @@

describe '#create' do
let(:server) do
double(:id => 'test123', :wait_for => true,
:public_ip_address => '1.2.3.4')
double(id: 'test123', wait_for: true,
public_ip_address: '1.2.3.4')
end
let(:driver) do
d = Kitchen::Driver::Digitalocean.new(config)
Expand All @@ -138,8 +138,8 @@
context 'username and API key only provided' do
let(:config) do
{
:digitalocean_client_id => 'hello',
:digitalocean_api_key => 'world'
digitalocean_client_id: 'hello',
digitalocean_api_key: 'world'
}
end

Expand All @@ -163,10 +163,10 @@
describe '#destroy' do
let(:server_id) { '12345' }
let(:hostname) { 'example.com' }
let(:state) { { :server_id => server_id, :hostname => hostname } }
let(:state) { { server_id: server_id, hostname: hostname } }
let(:server) { double(:nil? => false, :destroy => true) }
let(:servers) { double(:get => server) }
let(:compute) { double(:servers => servers) }
let(:servers) { double(get: server) }
let(:compute) { double(servers: servers) }

let(:driver) do
d = Kitchen::Driver::Digitalocean.new(config)
Expand Down Expand Up @@ -200,7 +200,7 @@
s.stub(:get).with('12345').and_return(nil)
s
end
let(:compute) { double(:servers => servers) }
let(:compute) { double(servers: servers) }
let(:driver) do
d = Kitchen::Driver::Digitalocean.new(config)
d.instance = instance
Expand All @@ -218,8 +218,8 @@
describe '#compute' do
let(:config) do
{
:digitalocean_client_id => 'monkey',
:digitalocean_api_key => 'potato',
digitalocean_client_id: 'monkey',
digitalocean_api_key: 'potato',
}
end

Expand All @@ -232,7 +232,7 @@

context 'no username provided' do
let(:config) do
{ :digitalocean_client_id => nil, :digitalocean_api_key => '1234' }
{ digitalocean_client_id: nil, digitalocean_api_key: '1234' }
end

it 'raises an error' do
Expand All @@ -242,7 +242,7 @@

context 'no API key provided' do
let(:config) do
{ :digitalocean_client_id => 'monkey', :digitalocean_api_key => nil }
{ digitalocean_client_id: 'monkey', digitalocean_api_key: nil }
end

it 'raises an error' do
Expand All @@ -254,16 +254,16 @@
describe '#create_server' do
let(:config) do
{
:server_name => 'hello',
:image_id => 'there',
:flavor_id => '68',
:region_id => '3',
:private_networking => true,
:ssh_key_ids => '1234'
server_name: 'hello',
image_id: 'there',
flavor_id: '68',
region_id: '3',
private_networking: true,
ssh_key_ids: '1234'
}
end
before(:each) do
@expected = config.merge(:name => config[:server_name])
@expected = config.merge(name: config[:server_name])
@expected.delete_if do |k, v|
k == :server_name
end
Expand All @@ -273,7 +273,7 @@
s.stub(:create) { |arg| arg }
s
end
let(:compute) { double(:servers => servers) }
let(:compute) { double(servers: servers) }
let(:driver) do
d = Kitchen::Driver::Digitalocean.new(config)
d.instance = instance
Expand All @@ -289,11 +289,11 @@
describe 'Region and Flavor names should be converted to IDs' do
let(:config) do
{
:server_name => 'hello',
:image_id => 'there',
:flavor => '2gb',
:region => 'amsterdam 2',
:ssh_key_ids => '1234'
server_name: 'hello',
image_id: 'there',
flavor: '2gb',
region: 'amsterdam 2',
ssh_key_ids: '1234'
}
end

Expand Down

0 comments on commit 38ce87a

Please sign in to comment.