summaryrefslogtreecommitdiff
path: root/spec/unit/api_client
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-05 15:00:00 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-05 15:00:00 -0800
commit686113531d23f30e9973d659c456ae33eb9cff1f (patch)
treef225de7251a8b49b8d183dd168bab0a0addbe23f /spec/unit/api_client
parentd1cf34b059a16a81e0fc48de52ba29863bb41fe6 (diff)
downloadchef-686113531d23f30e9973d659c456ae33eb9cff1f.tar.gz
autofixing whitespace cops
4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
Diffstat (limited to 'spec/unit/api_client')
-rw-r--r--spec/unit/api_client/registration_spec.rb21
1 files changed, 10 insertions, 11 deletions
diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb
index f41c5d8653..750223ad14 100644
--- a/spec/unit/api_client/registration_spec.rb
+++ b/spec/unit/api_client/registration_spec.rb
@@ -32,7 +32,7 @@ describe Chef::ApiClient::Registration do
subject(:registration) { Chef::ApiClient::Registration.new(client_name, key_location) }
let(:private_key_data) do
- File.open(Chef::Config[:validation_key], "r") {|f| f.read.chomp }
+ File.open(Chef::Config[:validation_key], "r") { |f| f.read.chomp }
end
let(:http_mock) { double("Chef::ServerAPI mock") }
@@ -67,7 +67,6 @@ describe Chef::ApiClient::Registration do
let(:generated_private_key) { OpenSSL::PKey::RSA.new(generated_private_key_pem) }
let(:generated_public_key) { generated_private_key.public_key }
-
let(:create_with_pkey_response) do
{
"uri" => "",
@@ -78,12 +77,12 @@ describe Chef::ApiClient::Registration do
end
let(:update_with_pkey_response) do
- {"name"=>client_name,
- "admin"=>false,
- "public_key"=> generated_public_key,
- "validator"=>false,
- "private_key"=>false,
- "clientname"=>client_name}
+ { "name" => client_name,
+ "admin" => false,
+ "public_key" => generated_public_key,
+ "validator" => false,
+ "private_key" => false,
+ "clientname" => client_name }
end
before do
@@ -217,7 +216,7 @@ describe Chef::ApiClient::Registration do
context "when the client key location is a symlink" do
it "does not follow the symlink", :unix_only do
- expected_flags = (File::CREAT|File::TRUNC|File::RDWR)
+ expected_flags = (File::CREAT | File::TRUNC | File::RDWR)
if defined?(File::NOFOLLOW)
expected_flags |= File::NOFOLLOW
@@ -232,7 +231,7 @@ describe Chef::ApiClient::Registration do
end
it "follows the symlink", :unix_only do
- expect(registration.file_flags).to eq(File::CREAT|File::TRUNC|File::RDWR)
+ expect(registration.file_flags).to eq(File::CREAT | File::TRUNC | File::RDWR)
end
end
end
@@ -271,7 +270,7 @@ describe Chef::ApiClient::Registration do
expect(http_mock).to receive(:post).exactly(6).times.and_raise(exception_500)
- expect {registration.run}.to raise_error(Net::HTTPFatalError)
+ expect { registration.run }.to raise_error(Net::HTTPFatalError)
end
end