diff options
author | tylercloke <tyler@opscode.com> | 2012-11-05 13:25:00 -0800 |
---|---|---|
committer | tylercloke <tyler@opscode.com> | 2012-11-05 16:07:55 -0800 |
commit | d0238d6ff8a32b10a76ae8ec059c8794d30ed6f3 (patch) | |
tree | d74d5d390e1ba9732e3ce04b042c58b694ebed34 /spec/unit/provider/git_spec.rb | |
parent | 926726fb40f738fa7d0c1c7944c8c3350a1694e8 (diff) | |
download | chef-d0238d6ff8a32b10a76ae8ec059c8794d30ed6f3.tar.gz |
Finished refactoring converge and updated tests
so that converge and converge! are no longer a method in the provider and why_run, respectively. There is instead set_updated_status in provider. Everything is now converged in why_run's add_action, so neither of the converge methods should ever need to be called. Updated tests to reflect this. Removed all calls to converge, and replaced with set_updated_status only for tests that are looking at the update status of a provider, where the converge behavior has been mocked out.
Diffstat (limited to 'spec/unit/provider/git_spec.rb')
-rw-r--r-- | spec/unit/provider/git_spec.rb | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/spec/unit/provider/git_spec.rb b/spec/unit/provider/git_spec.rb index bb8208dc27..275b2907ec 100644 --- a/spec/unit/provider/git_spec.rb +++ b/spec/unit/provider/git_spec.rb @@ -163,7 +163,6 @@ SHAS :environment =>{"GIT_SSH"=>"do_it_this_way.sh"}, :log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT) @provider.clone - @provider.converge end it "runs a clone command with escaped destination" do @@ -174,7 +173,6 @@ SHAS @provider.should_receive(:shell_out!).with(expected_cmd, :user => "deployNinja", :environment =>{"GIT_SSH"=>"do_it_this_way.sh"}, :log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT) @provider.clone - @provider.converge end it "compiles a clone command using --depth for shallow cloning" do @@ -182,7 +180,6 @@ SHAS expected_cmd = 'git clone --depth 5 git://github.com/opscode/chef.git /my/deploy/dir' @provider.should_receive(:shell_out!).with(expected_cmd, {:log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT}) @provider.clone - @provider.converge end it "compiles a clone command with a remote other than ``origin''" do @@ -190,14 +187,12 @@ SHAS expected_cmd = 'git clone -o opscode git://github.com/opscode/chef.git /my/deploy/dir' @provider.should_receive(:shell_out!).with(expected_cmd, {:log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT}) @provider.clone - @provider.converge end it "runs a checkout command with default options" do expected_cmd = 'git checkout -b deploy d35af14d41ae22b19da05d7d03a0bafc321b244c' @provider.should_receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir", :log_level => :debug, :log_tag => "git[web2.0 app]") @provider.checkout - @provider.converge end it "runs an enable_submodule command" do @@ -205,20 +200,17 @@ SHAS expected_cmd = "git submodule update --init --recursive" @provider.should_receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir", :log_level => :info, :log_tag => "git[web2.0 app]", :live_stream => STDOUT) @provider.enable_submodules - @provider.converge end it "does nothing for enable_submodules if resource.enable_submodules #=> false" do @provider.should_not_receive(:shell_out!) @provider.enable_submodules - @provider.converge end it "runs a sync command with default options" do expected_cmd = "git fetch origin && git fetch origin --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c" @provider.should_receive(:shell_out!).with(expected_cmd, :cwd=> "/my/deploy/dir", :log_level => :debug, :log_tag => "git[web2.0 app]") @provider.fetch_updates - @provider.converge end it "runs a sync command with the user and group specified in the resource" do @@ -228,7 +220,6 @@ SHAS @provider.should_receive(:shell_out!).with(expected_cmd, :cwd => "/my/deploy/dir", :user => "whois", :group => "thisis", :log_level => :debug, :log_tag => "git[web2.0 app]") @provider.fetch_updates - @provider.converge end it "configures remote tracking branches when remote is not ``origin''" do @@ -239,7 +230,6 @@ SHAS fetch_command = "git fetch opscode && git fetch opscode --tags && git reset --hard d35af14d41ae22b19da05d7d03a0bafc321b244c" @provider.should_receive(:shell_out!).with(fetch_command, :cwd => "/my/deploy/dir", :log_level => :debug, :log_tag => "git[web2.0 app]") @provider.fetch_updates - @provider.converge end it "raises an error if the git clone command would fail because the enclosing directory doesn't exist" do |