chef_cap 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module ChefCap
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
@@ -14,6 +14,7 @@ class ChefCapConfiguration
14
14
  @configuration.send(:set, :scm, :svn)
15
15
  @configuration.send(:depend, :remote, :command, "svn")
16
16
  end
17
+ @configuration.send(:set, :revision, ChefCapHelper.set_revision) if ChefCapHelper.has_revision?
17
18
  end
18
19
  end
19
- end
20
+ end
@@ -2,26 +2,46 @@ require File.expand_path(File.join(File.dirname(__FILE__), "spec_helper"))
2
2
 
3
3
  describe ChefCapConfiguration do
4
4
  describe ".set_repository_settings" do
5
- it "should set repository values for a git repository" do
6
- configuration = mock("Configuration")
7
- configuration.stub!(:repository => "git@somegitrepo")
8
- configuration.should_receive(:set).with(:scm, :git)
9
- configuration.should_receive(:set).with(:git_enable_submodules, 1)
10
- configuration.should_receive(:default_run_options).and_return({})
11
- configuration.should_receive(:depend).with(:remote, :command, "git")
12
- ChefCapConfiguration.configuration = configuration
5
+ context "the repository specific settings" do
6
+ before do
7
+ ENV["rev"] = "SOME_REV"
8
+ end
13
9
 
14
- ChefCapConfiguration.set_repository_settings
10
+ it "should set repository values for a git repository" do
11
+ configuration = mock("Configuration")
12
+ configuration.stub!(:repository => "git@somegitrepo")
13
+ configuration.should_receive(:set).with(:scm, :git)
14
+ configuration.should_receive(:set).with(:git_enable_submodules, 1)
15
+ configuration.should_receive(:default_run_options).and_return({})
16
+ configuration.should_receive(:depend).with(:remote, :command, "git")
17
+ configuration.should_receive(:set).with(:revision, anything)
18
+ ChefCapConfiguration.configuration = configuration
19
+
20
+ ChefCapConfiguration.set_repository_settings
21
+ end
22
+
23
+ it "should set repository values for an svn repository" do
24
+ configuration = mock("Configuration")
25
+ ChefCapConfiguration.configuration = configuration
26
+ configuration.stub!(:repository => "svn://somesvnrepo")
27
+ configuration.should_receive(:set).with(:scm, :svn)
28
+ configuration.should_receive(:depend).with(:remote, :command, "svn")
29
+ configuration.should_receive(:set).with(:revision, anything)
30
+
31
+ ChefCapConfiguration.set_repository_settings
32
+ end
15
33
  end
16
34
 
17
- it "should set repository values for an svn repository" do
35
+ it "should set the revision variable so other capistrano tasks will have the right revision value" do
18
36
  configuration = mock("Configuration")
19
37
  ChefCapConfiguration.configuration = configuration
20
- configuration.stub!(:repository => "svn://somesvnrepo")
21
- configuration.should_receive(:set).with(:scm, :svn)
22
- configuration.should_receive(:depend).with(:remote, :command, "svn")
38
+ configuration.stub!(:repository => nil)
39
+ ENV["rev"] = "SOME_REV"
40
+ configuration.should_receive(:set).with(:revision, "SOME_REV")
23
41
 
24
42
  ChefCapConfiguration.set_repository_settings
43
+ ENV["rev"] = nil
25
44
  end
45
+
26
46
  end
27
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef_cap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-12-05 00:00:00.000000000Z
12
+ date: 2011-12-07 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
16
- requirement: &2151808920 !ruby/object:Gem::Requirement
16
+ requirement: &2165477760 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.5.5
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151808920
24
+ version_requirements: *2165477760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec-rails
27
- requirement: &2151807980 !ruby/object:Gem::Requirement
27
+ requirement: &2165476780 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '2.1'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *2151807980
35
+ version_requirements: *2165476780
36
36
  description: chef_cap uses chef"s JSON config format to drive both capistrano and
37
37
  chef-solo"
38
38
  email:
@@ -91,7 +91,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
91
  version: '0'
92
92
  segments:
93
93
  - 0
94
- hash: -2296147763617098582
94
+ hash: 1089902353298414569
95
95
  required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
@@ -100,10 +100,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  version: '0'
101
101
  segments:
102
102
  - 0
103
- hash: -2296147763617098582
103
+ hash: 1089902353298414569
104
104
  requirements: []
105
105
  rubyforge_project:
106
- rubygems_version: 1.8.11
106
+ rubygems_version: 1.8.12
107
107
  signing_key:
108
108
  specification_version: 3
109
109
  summary: capistrano + chef-solo == chef_cap"