summaryrefslogtreecommitdiff
path: root/spec/unit/provider/subversion_spec.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-01-14 14:08:03 +0000
committerThom May <thom@chef.io>2016-01-14 14:08:03 +0000
commit51cfbdc4d16739caac4d946fadbe678444aafe34 (patch)
tree56dfd8f1cd9fd933de27268b32402e955a43ac2b /spec/unit/provider/subversion_spec.rb
parent05064423057d4cf46f4713b81b08829cf6d20af6 (diff)
downloadchef-51cfbdc4d16739caac4d946fadbe678444aafe34.tar.gz
Use double quotes by default
This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
Diffstat (limited to 'spec/unit/provider/subversion_spec.rb')
-rw-r--r--spec/unit/provider/subversion_spec.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb
index 9d4a8bd218..ff04a63b93 100644
--- a/spec/unit/provider/subversion_spec.rb
+++ b/spec/unit/provider/subversion_spec.rb
@@ -16,7 +16,7 @@
# limitations under the License.
#
-require 'spec_helper'
+require "spec_helper"
describe Chef::Provider::Subversion do
@@ -36,7 +36,7 @@ describe Chef::Provider::Subversion do
it "converts resource attributes to options for run_command and popen4" do
expect(@provider.run_options).to eq({})
- @resource.user 'deployninja'
+ @resource.user "deployninja"
expect(@provider.run_options).to eq({:user => "deployninja"})
end
@@ -64,7 +64,7 @@ describe Chef::Provider::Subversion do
"Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision
"Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n"
expect(::File).to receive(:exist?).at_least(1).times.with("/my/deploy/dir/.svn").and_return(true)
- expected_command = ["svn info", {:cwd => '/my/deploy/dir', :returns => [0,1]}]
+ expected_command = ["svn info", {:cwd => "/my/deploy/dir", :returns => [0,1]}]
expect(@provider).to receive(:shell_out!).with(*expected_command).
and_return(double("ShellOut result", :stdout => example_svn_info, :stderr => ""))
expect(@provider.find_current_revision).to eql("11410")
@@ -73,7 +73,7 @@ describe Chef::Provider::Subversion do
it "gives nil as the current revision if the deploy dir isn't a SVN working copy" do
example_svn_info = "svn: '/tmp/deploydir' is not a working copy\n"
expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
- expected_command = ["svn info", {:cwd => '/my/deploy/dir', :returns => [0,1]}]
+ expected_command = ["svn info", {:cwd => "/my/deploy/dir", :returns => [0,1]}]
expect(@provider).to receive(:shell_out!).with(*expected_command).
and_return(double("ShellOut result", :stdout => example_svn_info, :stderr => ""))
expect(@provider.find_current_revision).to be_nil
@@ -119,7 +119,7 @@ describe Chef::Provider::Subversion do
"Last Changed Rev: 11410\n" + # Last Changed Rev is preferred to Revision
"Last Changed Date: 2009-03-25 06:09:56 -0600 (Wed, 25 Mar 2009)\n\n"
@resource.revision "HEAD"
- expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", {:cwd => '/my/deploy/dir', :returns => [0,1]}]
+ expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", {:cwd => "/my/deploy/dir", :returns => [0,1]}]
expect(@provider).to receive(:shell_out!).with(*expected_command).
and_return(double("ShellOut result", :stdout => example_svn_info, :stderr => ""))
expect(@provider.revision_int).to eql("11410")
@@ -128,7 +128,7 @@ describe Chef::Provider::Subversion do
it "returns a helpful message if data from `svn info` can't be parsed" do
example_svn_info = "some random text from an error message\n"
@resource.revision "HEAD"
- expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", {:cwd => '/my/deploy/dir', :returns => [0,1]}]
+ expected_command = ["svn info http://svn.example.org/trunk/ --no-auth-cache -rHEAD", {:cwd => "/my/deploy/dir", :returns => [0,1]}]
expect(@provider).to receive(:shell_out!).with(*expected_command).
and_return(double("ShellOut result", :stdout => example_svn_info, :stderr => ""))
expect {@provider.revision_int}.to raise_error(RuntimeError, "Could not parse `svn info` data: some random text from an error message\n")
@@ -202,7 +202,7 @@ describe Chef::Provider::Subversion do
allow(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(false)
allow(::File).to receive(:exist?).with("/my/deploy/dir").and_return(true)
allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
- allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return(['.','..','foo','bar'])
+ allow(::Dir).to receive(:entries).with("/my/deploy/dir").and_return([".","..","foo","bar"])
expect(@provider).not_to receive(:checkout_command)
@provider.run_action(:checkout)
expect(@resource).not_to be_updated
@@ -246,7 +246,7 @@ describe Chef::Provider::Subversion do
it "does not fetch any updates if the remote revision matches the current revision" do
allow(::File).to receive(:directory?).with("/my/deploy").and_return(true)
expect(::File).to receive(:exist?).with("/my/deploy/dir/.svn").and_return(true)
- allow(@provider).to receive(:find_current_revision).and_return('12345')
+ allow(@provider).to receive(:find_current_revision).and_return("12345")
allow(@provider).to receive(:current_revision_matches_target_revision?).and_return(true)
@provider.run_action(:sync)
expect(@resource).not_to be_updated
@@ -267,29 +267,29 @@ describe Chef::Provider::Subversion do
it "selects 'svn' as the binary by default" do
@resource.svn_binary nil
allow(ChefConfig).to receive(:windows?) { false }
- expect(@provider).to receive(:svn_binary).and_return('svn')
+ expect(@provider).to receive(:svn_binary).and_return("svn")
expect(@provider.export_command).to eql(
- 'svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir')
+ "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
end
it "selects an svn binary with an exe extension on windows" do
@resource.svn_binary nil
allow(ChefConfig).to receive(:windows?) { true }
- expect(@provider).to receive(:svn_binary).and_return('svn.exe')
+ expect(@provider).to receive(:svn_binary).and_return("svn.exe")
expect(@provider.export_command).to eql(
- 'svn.exe export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir')
+ "svn.exe export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
end
it "uses a custom svn binary as part of the svn command" do
- @resource.svn_binary 'teapot'
- expect(@provider).to receive(:svn_binary).and_return('teapot')
+ @resource.svn_binary "teapot"
+ expect(@provider).to receive(:svn_binary).and_return("teapot")
expect(@provider.export_command).to eql(
- 'teapot export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir')
+ "teapot export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir")
end
it "wraps custom svn binary with quotes if it contains whitespace" do
- @resource.svn_binary 'c:/program files (x86)/subversion/svn.exe'
- expect(@provider).to receive(:svn_binary).and_return('c:/program files (x86)/subversion/svn.exe')
+ @resource.svn_binary "c:/program files (x86)/subversion/svn.exe"
+ expect(@provider).to receive(:svn_binary).and_return("c:/program files (x86)/subversion/svn.exe")
expect(@provider.export_command).to eql(
'"c:/program files (x86)/subversion/svn.exe" export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir')
end