capistrano_mailer 3.3.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,93 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "rvm paths" do
4
- include_context "Capistrano::Configuration"
5
-
6
- describe "default values" do
7
- before { @configuration.trigger(:load) }
8
-
9
- it "should return default system path" do
10
- @configuration.fetch(:rvm_system_path).should == '/usr/local/rvm'
11
- end
12
-
13
- it "should return default user path" do
14
- @configuration.fetch(:rvm_user_path).should == '$HOME/.rvm'
15
- end
16
-
17
- it "should return default installation mode" do
18
- @configuration.fetch(:rvm_type).should == :user
19
- end
20
-
21
- it "should return default path" do
22
- @configuration.fetch(:rvm_path).should == '$HOME/.rvm'
23
- end
24
-
25
- it "should return default bin path" do
26
- @configuration.fetch(:rvm_bin_path).should == '$HOME/.rvm/bin'
27
- end
28
-
29
- it "should return default gemset path" do
30
- @configuration.fetch(:rvm_gemset_path).should == '$HOME/.rvm/gemsets'
31
- end
32
- end
33
-
34
- describe "system mode" do
35
- before do
36
- @configuration.set(:rvm_type, :system)
37
- @configuration.trigger(:load)
38
- end
39
-
40
- it "should return default path" do
41
- @configuration.fetch(:rvm_path).should == '/usr/local/rvm'
42
- end
43
-
44
- it "should return system bin path" do
45
- @configuration.fetch(:rvm_bin_path).should == '/usr/local/rvm/bin'
46
- end
47
-
48
- it "should return system gemset path" do
49
- @configuration.fetch(:rvm_gemset_path).should == '/usr/local/rvm/gemsets'
50
- end
51
- end
52
-
53
- describe "invalid configuration values" do
54
- context "in :mixed mode" do
55
- before { @configuration.set(:rvm_type, :mixed) }
56
-
57
- it "should abort if rvm_type is :mixed and rvm_user empty" do
58
- expect { @configuration.trigger(:load) }.to \
59
- abort_with_error(/When rvm_type is :mixed, you must also set rvm_user/)
60
- end
61
-
62
- it "should abort if rvm_user isn't an Array" do
63
- @configuration.set(:rvm_user, "a string")
64
- expect { @configuration.trigger(:load) }.to \
65
- abort_with_error(/rvm_user must be an Array/)
66
- end
67
-
68
- it "should abort if rvm_user contains an invalid value" do
69
- @configuration.set(:rvm_user, [ :invalid_value ])
70
- expect { @configuration.trigger(:load) }.to \
71
- abort_with_error(/Invalid value\(s\) in rvm_user: invalid_value/)
72
- end
73
-
74
- it "should abort if rvm_user mixes :none with other values" do
75
- @configuration.set(:rvm_user, [ :none, :gemsets ])
76
- expect { @configuration.trigger(:load) }.to \
77
- abort_with_error(/rvm_user cannot mix :none with other values/)
78
- end
79
-
80
- it "should abort if rvm_user mixes :all with other values" do
81
- @configuration.set(:rvm_user, [ :gemsets, :all ])
82
- expect { @configuration.trigger(:load) }.to \
83
- abort_with_error(/rvm_user cannot mix :all with other values/)
84
- end
85
- end
86
-
87
- it "should abort if rvm_user is set and rvm_type isn't :mixed" do
88
- @configuration.set(:rvm_user, [ :gemsets ])
89
- expect { @configuration.trigger(:load) }.to \
90
- abort_with_error(/rvm_user must not be set unless rvm_type is :mixed/)
91
- end
92
- end
93
- end
@@ -1,3 +0,0 @@
1
- # Requires supporting files with custom matchers and macros, etc,
2
- # in ./support/ and its subdirectories.
3
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -1,42 +0,0 @@
1
- require 'rspec/expectations'
2
-
3
- RSpec::Matchers.define :abort_with_error do |message|
4
- match do |block|
5
- @block = block
6
- with_fake_stderr do
7
- @got_system_exit = false
8
- begin
9
- block.call
10
- rescue SystemExit
11
- @got_system_exit = true
12
- @stderr = $stderr.string
13
- message ? message === @stderr : true
14
- else
15
- false
16
- end
17
- end
18
- end
19
-
20
- description do
21
- "blahhh"
22
- end
23
-
24
- failure_message_for_should do |actual|
25
- if @got_system_exit
26
- "expected STDERR to match " + \
27
- ((message.is_a?(Regexp) ? "/%s/" : "'%s'") % message) + \
28
- " but got:\n#{@stderr}"
29
- else
30
- "expected #{@block} to raise SystemExit"
31
- end
32
- end
33
-
34
- # Fake STDERR and return a string written to it.
35
- def with_fake_stderr
36
- original_stderr = $stderr
37
- $stderr = StringIO.new
38
- yield
39
- ensure
40
- $stderr = original_stderr
41
- end
42
- end
@@ -1,24 +0,0 @@
1
- require 'capistrano-spec'
2
- require 'capistrano'
3
-
4
- RSpec.configure do |config|
5
- config.include Capistrano::Spec::Matchers
6
- config.include Capistrano::Spec::Helpers
7
- end
8
-
9
- shared_context "Capistrano::Configuration" do
10
- before do
11
- @configuration = Capistrano::Configuration.new
12
- $:.unshift File.dirname(__FILE__) + '/../../lib'
13
- # @configuration.load_paths.unshift File.dirname(__FILE__) + '/../../lib'
14
- Capistrano::Configuration.instance = @configuration
15
-
16
- # define _cset etc. from capistrano
17
- @configuration.load 'deploy'
18
-
19
- # load rvm/capistrano/base etc.
20
- @configuration.require 'rvm/capistrano'
21
-
22
- @configuration.extend(Capistrano::Spec::ConfigurationExtension)
23
- end
24
- end
@@ -1,18 +0,0 @@
1
- require 'test/unit'
2
- require 'yaml'
3
- require 'rubygems/specification'
4
-
5
- class BuildGemTest < Test::Unit::TestCase
6
- def test_build_gem
7
- data = File.read(File.join(File.dirname(__FILE__), '..', 'capistrano_mailer.gemspec'))
8
- spec = nil
9
-
10
- if data !~ %r{!ruby/object:Gem::Specification}
11
- Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
12
- else
13
- spec = YAML.load(data)
14
- end
15
-
16
- assert spec.validate
17
- end
18
- end
@@ -1,39 +0,0 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5
- <title><%= @site_name %> Notification </title>
6
- </head>
7
- <body style="font: 14px normal Helvetica, Arial, Sans; background: #999;">
8
-
9
- <div style="width:800px; margin: 10px auto; background: #fff; border: 10px solid #aaa;">
10
-
11
- <h1 style="clear: both; margin: 0; padding: 5px 20px 5px 20px; border-bottom: 1px dotted; background: #ccc;">
12
- <%= @site_name %> <%=@task_name.titleize unless @task_name.nil? %>
13
- </h1>
14
-
15
- <% unless @site_url.nil? %>
16
- <p style="margin: 8px 0 20px 20px; padding: 0px; font-style: italic;" >
17
- View site: <a href="<%= @site_url -%>"><%= @site_url -%></a>
18
- </p>
19
- <% end %>
20
-
21
- <p style="margin: 10px 20px; font-weight: bold;">Released: <%= @date %> at <%= @time %></p>
22
-
23
- <%= @sections.map { |section|
24
- data = @section_data[section.to_sym]
25
- if !data.empty?
26
- if %w(extra_information release_data).include?(section)
27
- render :partial => 'section_custom.html.erb', :locals => {:section_title => section, :data => data}
28
- else
29
- render :partial => 'section.html.erb', :locals => {:section_title => section, :data => data}
30
- end
31
- end
32
- }.join unless @sections.nil? %>
33
- </div>
34
-
35
- <p style="margin: 8px 0 20px 20px; padding: 0px; font-style: italic;" >
36
- Brought to you by: <a href="http://github.com/textgoeshere/capistrano_mailer">Capistrano Mailer</a>
37
- </p>
38
- </body>
39
- </html>
@@ -1,22 +0,0 @@
1
- <%= @site_name %> Notification
2
- ===========================================================
3
-
4
- <%= @site_name %> <%=@task_name.titleize unless @task_name.nil? %>
5
- ===========================================================
6
- Brought to you by: Capistrano Mailer - http://github.com/pboling/capistrano_mailer
7
- Released: <%= @date %> at <%= @time %>
8
-
9
- <%= @sections.map { |section|
10
- data = @section_data[section.to_sym]
11
- if !data.empty?
12
- if %w(extra_information release_data).include?(section)
13
- render :partial => 'section_custom.text.erb', :locals => {:section_title => section, :data => data}
14
- else
15
- render :partial => 'section.text.erb', :locals => {:section_title => section, :data => data}
16
- end
17
- end
18
- }.join unless @sections.nil? %>
19
-
20
- ===========================================================
21
- Copyright 2009 9thBit LLC under MIT License
22
- Copyright 2007-8 Sagebit LLC under MIT License
@@ -1 +0,0 @@
1
- <%= render "message_body" %>
@@ -1 +0,0 @@
1
- <%= render "message_body" %>
@@ -1 +0,0 @@
1
- <%= render "message_body" %>