summaryrefslogtreecommitdiff
path: root/spec/unit/resource/remote_file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/resource/remote_file_spec.rb')
-rw-r--r--spec/unit/resource/remote_file_spec.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/spec/unit/resource/remote_file_spec.rb b/spec/unit/resource/remote_file_spec.rb
index b511377a51..cd6ca9fd59 100644
--- a/spec/unit/resource/remote_file_spec.rb
+++ b/spec/unit/resource/remote_file_spec.rb
@@ -20,7 +20,6 @@
require "spec_helper"
describe Chef::Resource::RemoteFile do
-
before(:each) do
@resource = Chef::Resource::RemoteFile.new("fakey_fakerton")
end
@@ -66,7 +65,7 @@ describe Chef::Resource::RemoteFile do
end
it "should accept a delayed evalutator (string) for the remote file source" do
- @resource.source Chef::DelayedEvaluator.new {"http://opscode.com/"}
+ @resource.source Chef::DelayedEvaluator.new { "http://opscode.com/" }
expect(@resource.source).to eql([ "http://opscode.com/" ])
end
@@ -87,13 +86,13 @@ describe Chef::Resource::RemoteFile do
it "should only accept a single argument if a delayed evalutor is used" do
expect {
- @resource.source("http://opscode.com/", Chef::DelayedEvaluator.new {"http://opscode.com/"})
+ @resource.source("http://opscode.com/", Chef::DelayedEvaluator.new { "http://opscode.com/" })
}.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
it "should only accept a single array item if a delayed evalutor is used" do
expect {
- @resource.source(["http://opscode.com/", Chef::DelayedEvaluator.new {"http://opscode.com/"}])
+ @resource.source(["http://opscode.com/", Chef::DelayedEvaluator.new { "http://opscode.com/" }])
}.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
@@ -103,7 +102,7 @@ describe Chef::Resource::RemoteFile do
it "does not accept a non-URI as the source when read from a delayed evaluator" do
expect {
- @resource.source(Chef::DelayedEvaluator.new {"not-a-uri"})
+ @resource.source(Chef::DelayedEvaluator.new { "not-a-uri" })
@resource.source
}.to raise_error(Chef::Exceptions::InvalidRemoteFileURI)
end
@@ -111,7 +110,6 @@ describe Chef::Resource::RemoteFile do
it "should raise an exception when source is an empty array" do
expect { @resource.source([]) }.to raise_error(ArgumentError)
end
-
end
describe "checksum" do
@@ -163,7 +161,6 @@ describe Chef::Resource::RemoteFile do
expect(@resource.use_last_modified).to be_falsey
expect(@resource.use_etags).to be_truthy
end
-
end
describe "when it has group, mode, owner, source, and checksum" do
@@ -179,20 +176,20 @@ describe Chef::Resource::RemoteFile do
@resource.owner("root")
end
@resource.source("https://www.google.com/images/srpr/logo3w.png")
- @resource.checksum("1"*26)
+ @resource.checksum("1" * 26)
end
it "describes its state" do
state = @resource.state
if Chef::Platform.windows?
puts state
- expect(state[:rights]).to eq([{:permissions => :read, :principals => "Everyone"}])
- expect(state[:deny_rights]).to eq([{:permissions => :full_control, :principals => "Clumsy_Sam"}])
+ expect(state[:rights]).to eq([{ :permissions => :read, :principals => "Everyone" }])
+ expect(state[:deny_rights]).to eq([{ :permissions => :full_control, :principals => "Clumsy_Sam" }])
else
expect(state[:group]).to eq("pokemon")
expect(state[:mode]).to eq("0664")
expect(state[:owner]).to eq("root")
- expect(state[:checksum]).to eq("1"*26)
+ expect(state[:checksum]).to eq("1" * 26)
end
end