public
Rubygem
Description: Bang! You've deployed!
Homepage: http://opensource.thinkrelevance.com/
Clone URL: git://github.com/relevance/cap_gun.git
Search Repo:
more specs and few more renames
rsanheim (author)
Sun Apr 06 19:55:56 -0700 2008
commit  97a210769aae4cc459a64d48aadbbb13a6c4f79e
tree    5f1a60c0cf81b1027e806bf2aac284519ecb4183
parent  6b81673475488f297919c43a3c0d7dbe4a1a3090
...
32
33
34
 
 
35
36
37
...
32
33
34
35
36
37
38
39
0
@@ -32,6 +32,8 @@
0
     # Loads ActionMailer settings from a Capistrano variable called "cap_gun_action_mailer_config"
0
     def load_mailer_config(cap)
0
       raise ArgumentError, "You must define ActionMailer settings in 'cap_gun_action_mailer_config'" unless cap.cap_gun_action_mailer_config
0
+ raise ArgumentError, "Need at least one recipient." if !cap.exists?(:cap_gun_options) || cap.cap_gun_options[:recipients].blank?
0
+
0
       ActionMailer::Base.smtp_settings = cap.cap_gun_action_mailer_config
0
     end
0
   
...
23
24
25
26
 
27
28
29
 
 
 
 
 
 
 
 
 
 
 
 
 
30
31
32
33
...
53
54
55
56
57
58
59
60
 
61
62
63
...
23
24
25
 
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
66
67
68
 
 
 
69
 
70
71
72
73
0
@@ -23,10 +23,23 @@
0
     end
0
   
0
     it "gets action mailer config from capistrano" do
0
- capistrano = stub(:cap_gun_action_mailer_config => {:account => "foo@gmail.com", :password => "password"}"})
0
+ capistrano = stub(:cap_gun_action_mailer_config => {:account => "foo@gmail.com", :password => "password"}, :exists? => true, :cap_gun_options => {:recipients => "foo"})
0
       CapGun::Helper.load_mailer_config(capistrano)
0
       ActionMailer::Base.smtp_settings.should == {:account => "foo@gmail.com", :password => "password"}
0
     end
0
+
0
+ it "raises if we have no cap gun options" do
0
+ capistrano = stub_everything(:cap_gun_action_mailer_config => {}, :exists? => false)
0
+ lambda { CapGun::Helper.load_mailer_config capistrano }.should.raise(ArgumentError)
0
+ end
0
+
0
+ it "raises if we dont have at least one recipient" do
0
+ capistrano = stub_everything(:cap_gun_action_mailer_config => {}, :cap_gun_options => {})
0
+ lambda { CapGun::Helper.load_mailer_config capistrano }.should.raise(ArgumentError)
0
+ capistrano = stub_everything(:cap_gun_action_mailer_config => {}, :cap_gun_options => {:recipients => []})
0
+ lambda { CapGun::Helper.load_mailer_config capistrano }.should.raise(ArgumentError)
0
+ end
0
+
0
   end
0
   
0
   describe "misc helpers" do
0
0
@@ -53,11 +66,8 @@
0
   end
0
   
0
   describe "Mailer" do
0
- it "raises if we dont have at least one recipient" do
0
- end
0
-
0
     it "passes capistrano into create body" do
0
- capistrano = { :current_release => "/data/foo", :previous_release => "/data/foo", :cap_gun_options => {:recipients => "joe@example.com"} }
0
+ capistrano = { :current_release => "/data/foo", :previous_release => "/data/foo", :cap_gun_options => {:recipients => ["joe@example.com"]} }
0
       CapGun::Mailer.any_instance.expects(:create_body).with(capistrano).returns("foo")
0
       CapGun::Mailer.create_deployment_notification capistrano
0
       
...
1
2
 
3
4
...
1
 
2
3
4
0
@@ -1,5 +1,5 @@
0
 # desc "Explaining what the task does"
0
-# task :cap_bot do
0
+# task :cap_gun do
0
 # # Task goes here
0
 # end

Comments

    No one has commented yet.