rapid-app 0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +6 -0
- data/.rspec +2 -0
- data/Gemfile +11 -0
- data/Rakefile +4 -0
- data/lib/rapid/app/settings.rb +259 -0
- data/lib/rapid/app/skeleton.rb +213 -0
- data/lib/rapid/app/version.rb +5 -0
- data/lib/rapid/app.rb +13 -0
- data/lib/rapid-app.rb +5 -0
- data/rapid-app.gemspec +33 -0
- data/spec/rapid/app/skeleton_spec.rb +50 -0
- data/spec/rapid/app_spec.rb +12 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/support/more_string_matchers.rb +21 -0
- data/spec/support/rapid.rb +1 -0
- data/spec/templates/app/controllers/application_controller_spec.rb +32 -0
- data/spec/templates/app/helpers/application_helper_spec.rb +32 -0
- data/spec/templates/app/mailers/test_mailer_spec.rb +22 -0
- data/spec/templates/app/views/test_mailer/test_email.text.erb_spec.rb +36 -0
- data/spec/templates/config/application_spec.rb +168 -0
- data/spec/templates/config/boot_spec.rb +17 -0
- data/spec/templates/config/cucumber.yml_spec.rb +22 -0
- data/spec/templates/config/deploy/production_spec.rb +155 -0
- data/spec/templates/config/deploy_spec.rb +156 -0
- data/spec/templates/config/environment_spec.rb +22 -0
- data/spec/templates/config/environments/development_spec.rb +50 -0
- data/spec/templates/config/environments/production_spec.rb +50 -0
- data/spec/templates/config/environments/test_spec.rb +50 -0
- data/spec/templates/config/initializers/airbrake_spec.rb +70 -0
- data/spec/templates/config/initializers/backtrace_silencers_spec.rb +17 -0
- data/spec/templates/config/initializers/email_spec.rb +106 -0
- data/spec/templates/config/initializers/mime_types_spec.rb +17 -0
- data/spec/templates/config/initializers/secret_token_spec.rb +36 -0
- data/spec/templates/config/initializers/session_store_spec.rb +36 -0
- data/spec/templates/config/initializers/wrap_parameters_spec.rb +17 -0
- data/spec/templates/config/roodi.yml_spec.rb +92 -0
- data/spec/templates/config/routes_spec.rb +36 -0
- data/spec/templates/config/schedule_spec.rb +22 -0
- data/spec/templates/config.ru_spec.rb +22 -0
- data/spec/templates/db/migrate/create_jobs_spec.rb +17 -0
- data/spec/templates/features/step_definitions/email_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/browsing_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/debug_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/form_steps_spec.rb +17 -0
- data/spec/templates/features/step_definitions/web_steps/step_scoper_spec.rb +17 -0
- data/spec/templates/features/support/email_spec.rb +17 -0
- data/spec/templates/features/support/env_spec.rb +56 -0
- data/spec/templates/features/support/paths_spec.rb +22 -0
- data/spec/templates/features/support/selectors_spec.rb +22 -0
- data/spec/templates/features/support/with_scope_spec.rb +17 -0
- data/spec/templates/lib/tasks/cucumber.rake_spec.rb +17 -0
- data/spec/templates/lib/tasks/test.rake_spec.rb +147 -0
- data/spec/templates/lib/tasks/test_mailer.rake_spec.rb +17 -0
- data/spec/templates/rspec_spec.rb +17 -0
- data/spec/templates/script/delayed_job_spec.rb +17 -0
- data/spec/templates/script/rails_spec.rb +17 -0
- data/spec/templates/spec/factories_spec.rb +27 -0
- data/spec/templates/spec/spec_helper_spec.rb +56 -0
- data/spec/templates/test/test_helper_spec.rb +17 -0
- data/templates/app/controllers/application_controller.rb +3 -0
- data/templates/app/helpers/application_helper.rb +2 -0
- data/templates/app/mailers/test_mailer.rb +7 -0
- data/templates/app/views/test_mailer/test_email.text.erb +4 -0
- data/templates/config/application.rb +32 -0
- data/templates/config/boot.rb +6 -0
- data/templates/config/cucumber.yml +8 -0
- data/templates/config/deploy/production.rb +37 -0
- data/templates/config/deploy.rb +43 -0
- data/templates/config/environment.rb +5 -0
- data/templates/config/environments/development.rb +35 -0
- data/templates/config/environments/production.rb +64 -0
- data/templates/config/environments/test.rb +46 -0
- data/templates/config/initializers/airbrake.rb +9 -0
- data/templates/config/initializers/backtrace_silencers.rb +7 -0
- data/templates/config/initializers/email.rb +10 -0
- data/templates/config/initializers/mime_types.rb +5 -0
- data/templates/config/initializers/secret_token.rb +7 -0
- data/templates/config/initializers/session_store.rb +8 -0
- data/templates/config/initializers/wrap_parameters.rb +14 -0
- data/templates/config/roodi.yml +13 -0
- data/templates/config/routes.rb +3 -0
- data/templates/config/schedule.rb +1 -0
- data/templates/config.ru +4 -0
- data/templates/db/migrate/create_jobs.rb +22 -0
- data/templates/features/step_definitions/email_steps.rb +194 -0
- data/templates/features/step_definitions/web_steps/browsing_steps.rb +82 -0
- data/templates/features/step_definitions/web_steps/debug_steps.rb +3 -0
- data/templates/features/step_definitions/web_steps/form_steps.rb +210 -0
- data/templates/features/step_definitions/web_steps/step_scoper.rb +9 -0
- data/templates/features/support/email.rb +2 -0
- data/templates/features/support/env.rb +55 -0
- data/templates/features/support/paths.rb +27 -0
- data/templates/features/support/selectors.rb +24 -0
- data/templates/features/support/with_scope.rb +6 -0
- data/templates/lib/tasks/cucumber.rake +65 -0
- data/templates/lib/tasks/test.rake +49 -0
- data/templates/lib/tasks/test_mailer.rake +10 -0
- data/templates/rspec +2 -0
- data/templates/script/delayed_job +5 -0
- data/templates/script/rails +6 -0
- data/templates/spec/factories.rb +1 -0
- data/templates/spec/spec_helper.rb +47 -0
- data/templates/test/test_helper.rb +13 -0
- metadata +316 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/app/controllers/application_controller.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "controllers.application.body" do
|
|
9
|
+
|
|
10
|
+
it "should push content" do
|
|
11
|
+
push 'controllers.application.body' => 'foo bar'
|
|
12
|
+
@result.should == %(class ApplicationController < ActionController::Base\n foo bar\nend\n)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should push blank " do
|
|
16
|
+
push
|
|
17
|
+
@result.should == %(class ApplicationController < ActionController::Base\n \nend\n)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should pull content" do
|
|
21
|
+
pull %(class ApplicationController < ActionController::Base\n foo bar\nend\n)
|
|
22
|
+
@result.should == {'controllers.application.body' => 'foo bar'}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should pull blank" do
|
|
26
|
+
pull %(class ApplicationController < ActionController::Base\n \nend\n)
|
|
27
|
+
@result.should == {'controllers.application.body' => ''}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/app/helpers/application_helper.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "helpers.application.body" do
|
|
9
|
+
|
|
10
|
+
it "should push content" do
|
|
11
|
+
push 'helpers.application.body' => "\n foo bar"
|
|
12
|
+
@result.should == %(module ApplicationHelper\n foo bar\nend\n)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should push blank" do
|
|
16
|
+
push
|
|
17
|
+
@result.should == %(module ApplicationHelper\nend\n)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should pull content" do
|
|
21
|
+
pull 'helpers.application.body' => %( def foo\n 1\n end\n\n def bar\n 2\n end\n)
|
|
22
|
+
@result.should == {'helpers.application.body' => %( def foo\n 1\n end\n\n def bar\n 2\n end\n)}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should pull blank" do
|
|
26
|
+
pull %(module ApplicationHelper\nend\n)
|
|
27
|
+
@result.should == {'helpers.application.body' => ''}
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/app/mailers/test_mailer.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "subject" do
|
|
9
|
+
|
|
10
|
+
it "should push" do
|
|
11
|
+
push 'email.test.subject' => 'My Subject'
|
|
12
|
+
@result.should include(%(:subject => "My Subject"))
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should pull" do
|
|
16
|
+
pull 'email.test.subject' => 'My Subject'
|
|
17
|
+
@result.should == {'email.test.subject' => 'My Subject'}
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/views/test_mailer/test.text.erb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "name" do
|
|
9
|
+
|
|
10
|
+
it "should push" do
|
|
11
|
+
push 'name' => 'My App'
|
|
12
|
+
@result.should match(/\nMy App$/)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should pull" do
|
|
16
|
+
pull 'name' => 'My App'
|
|
17
|
+
@result['name'].should == 'My App'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe "email.test.message" do
|
|
23
|
+
|
|
24
|
+
it "should push" do
|
|
25
|
+
push 'email.test.message' => 'Test is working!'
|
|
26
|
+
@result.should match(/^Test is working!/)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "should pull" do
|
|
30
|
+
pull 'email.test.message' => 'Test is working!'
|
|
31
|
+
@result['email.test.message'].should == 'Test is working!'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/config/application.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "rails_all" do
|
|
9
|
+
|
|
10
|
+
it "should push true" do
|
|
11
|
+
push
|
|
12
|
+
@result.should include %(require 'rails/all')
|
|
13
|
+
@result.should_not include %(require "action_controller/railtie")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should push false" do
|
|
17
|
+
push "database.sqlite" => nil
|
|
18
|
+
@result.should_not include %(require 'rails/all')
|
|
19
|
+
@result.should include %(require "action_controller/railtie")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it "should pull true" do
|
|
23
|
+
pull
|
|
24
|
+
@result['rails_all'].should == true
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
it "should pull false" do
|
|
28
|
+
pull 'database.sqlite' => nil
|
|
29
|
+
@result['rails_all'].should == false
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
describe "database.active_record" do
|
|
35
|
+
|
|
36
|
+
it "should push true" do
|
|
37
|
+
push 'test.unit' => nil
|
|
38
|
+
@result.should include %(\nrequire "active_record/railtie")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it "should push false" do
|
|
42
|
+
push 'database.sqlite' => nil
|
|
43
|
+
@result.should include %(\n# require "active_record/railtie")
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
it "should pull true" do
|
|
47
|
+
pull 'test.unit' => nil
|
|
48
|
+
@result['database.active_record'].should == true
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it "should pull false" do
|
|
52
|
+
pull 'database.sqlite' => nil
|
|
53
|
+
@result['database.active_record'].should == false
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe "assets" do
|
|
59
|
+
|
|
60
|
+
it "should push true" do
|
|
61
|
+
push 'test.unit' => nil
|
|
62
|
+
@result.should include %(\nrequire "sprockets/railtie")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it "should push false" do
|
|
66
|
+
push 'assets' => nil
|
|
67
|
+
@result.should include %(\n# require "sprockets/railtie")
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
it "should pull true" do
|
|
71
|
+
pull 'test.unit' => nil
|
|
72
|
+
@result['assets'].should == true
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
it "should pull false" do
|
|
76
|
+
pull 'assets' => nil
|
|
77
|
+
@result['assets'].should == false
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
describe "test.unit" do
|
|
83
|
+
|
|
84
|
+
it "should push true" do
|
|
85
|
+
push 'assets' => nil
|
|
86
|
+
@result.should include %(\nrequire "rails/test_unit/railtie")
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
it "should push false" do
|
|
90
|
+
push 'test.unit' => nil
|
|
91
|
+
@result.should include %(\n# require "rails/test_unit/railtie")
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
it "should pull true" do
|
|
95
|
+
pull 'assets' => nil
|
|
96
|
+
@result['test.unit'].should == true
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
it "should pull false" do
|
|
100
|
+
pull 'test.unit' => nil
|
|
101
|
+
@result['test.unit'].should == false
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
describe "module_name" do
|
|
107
|
+
|
|
108
|
+
it "should push" do
|
|
109
|
+
push 'name' => "hello_world"
|
|
110
|
+
@result.should include %(module HelloWorld)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
it "should pull" do
|
|
114
|
+
pull 'name' => "hello_world"
|
|
115
|
+
@result['module_name'].should == "HelloWorld"
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
describe "timezone" do
|
|
121
|
+
|
|
122
|
+
it "should push default" do
|
|
123
|
+
push
|
|
124
|
+
@result.should include %(# config.time_zone = 'Central Time (US & Canada)')
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
it "should push custom" do
|
|
128
|
+
push 'timezone' => "Eastern Time (US & Canada)"
|
|
129
|
+
@result.should include %( config.time_zone = 'Eastern Time (US & Canada)')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
it "should pull default" do
|
|
133
|
+
pull 'timezone' => nil
|
|
134
|
+
@result['timezone'].should == false
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
it "should pull custom" do
|
|
138
|
+
pull 'timezone' => "Eastern Time (US & Canada)"
|
|
139
|
+
@result['timezone'].should == "Eastern Time (US & Canada)"
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
describe "config.body" do
|
|
145
|
+
|
|
146
|
+
it "should push code" do
|
|
147
|
+
push 'config.body' => "config.something = 'foo'"
|
|
148
|
+
@result.should include %(config.something = 'foo')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
it "should push blank" do
|
|
152
|
+
push
|
|
153
|
+
@result.should include "US & Canada)'\n\n end\nend"
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
it "should pull code" do
|
|
157
|
+
pull 'config.body' => "config.something = 'foo'"
|
|
158
|
+
@result['config.body'].should == %(config.something = 'foo')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
it "should pull blank" do
|
|
162
|
+
pull
|
|
163
|
+
@result['config.body'].should == ""
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/config/boot.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
it "should push" do
|
|
9
|
+
push
|
|
10
|
+
@result.should include %(require 'bundler/setup')
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "should pull" do
|
|
14
|
+
pull
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/config/cucumber.yml" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "test.cucumber.wip.max" do
|
|
9
|
+
|
|
10
|
+
it "should push" do
|
|
11
|
+
push 'test.cucumber.wip.max' => '20'
|
|
12
|
+
@result.should include %(@wip:20)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should pull" do
|
|
16
|
+
pull 'test.cucumber.wip.max' => '20'
|
|
17
|
+
@result['test.cucumber.wip.max'].should == '20'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/config/deploy/production.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "deploy.production.user" do
|
|
9
|
+
|
|
10
|
+
it "should push" do
|
|
11
|
+
push 'deploy.production.user' => 'deploy'
|
|
12
|
+
@result.should include %(set :user, "deploy"\n)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should pull" do
|
|
16
|
+
pull 'deploy.production.user' => 'deploy'
|
|
17
|
+
@result['deploy.production.user'].should == %(deploy)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
describe "deploy.production.path" do
|
|
23
|
+
|
|
24
|
+
it "should push" do
|
|
25
|
+
push 'deploy.production.path' => '/bin'
|
|
26
|
+
@result.should include %(set :deploy_to, "/bin")
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "should pull" do
|
|
30
|
+
pull 'deploy.production.path' => '/bin'
|
|
31
|
+
@result['deploy.production.path'].should == %(/bin)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe "deploy.production.branch" do
|
|
37
|
+
|
|
38
|
+
it "should push" do
|
|
39
|
+
push 'deploy.production.branch' => 'master'
|
|
40
|
+
@result.should include %(set :branch, "master"\n)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
it "should pull" do
|
|
44
|
+
pull 'deploy.production.branch' => 'master'
|
|
45
|
+
@result['deploy.production.branch'].should == 'master'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
describe "deploy.production.keep" do
|
|
51
|
+
|
|
52
|
+
it "should push" do
|
|
53
|
+
push 'deploy.production.keep' => 5
|
|
54
|
+
@result.should include %(set :keep_releases, 5\n)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
it "should pull" do
|
|
58
|
+
pull 'deploy.production.keep' => 5
|
|
59
|
+
@result['deploy.production.keep'].should == "5"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe "deploy.production.domain" do
|
|
65
|
+
|
|
66
|
+
it "should push" do
|
|
67
|
+
push 'deploy.production.domain' => 'myapp.com'
|
|
68
|
+
@result.should include %(role :web, "myapp.com")
|
|
69
|
+
@result.should include %(role :app, "myapp.com")
|
|
70
|
+
@result.should include %(role :db, "myapp.com", :primary => true)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
it "should pull" do
|
|
74
|
+
pull 'deploy.production.domain' => 'myapp.com'
|
|
75
|
+
@result['deploy.production.domain'].should == 'myapp.com'
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
describe "deploy.production.server" do
|
|
81
|
+
|
|
82
|
+
it "should push" do
|
|
83
|
+
push 'deploy.production.server' => 'passenger'
|
|
84
|
+
@result.should include 'run "touch #{deploy_to}/current/tmp/restart.txt"'
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
it "should pull" do
|
|
88
|
+
pull 'deploy.production.server' => 'passenger'
|
|
89
|
+
@result['deploy.production.server'].should == %(passenger)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
describe "deploy.production.bin" do
|
|
95
|
+
|
|
96
|
+
it "should push" do
|
|
97
|
+
push 'deploy.production.bin' => '/opt/local/bin'
|
|
98
|
+
@result.should include %(set :bundle_cmd, "/opt/local/bin/bundle")
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it "should pull" do
|
|
102
|
+
pull 'deploy.production.bin' => '/opt/local/bin'
|
|
103
|
+
@result['deploy.production.bin'].should == %(/opt/local/bin)
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
describe "deploy.production.rvm" do
|
|
109
|
+
|
|
110
|
+
it "should push" do
|
|
111
|
+
push 'deploy.production.rvm.type' => 'user',
|
|
112
|
+
'deploy.production.rvm.ruby' => 'ree',
|
|
113
|
+
'deploy.production.rvm.gemset' => 'rapid'
|
|
114
|
+
|
|
115
|
+
@result.should include %(set :rvm_type, :user)
|
|
116
|
+
@result.should include %(set :rvm_ruby_string, 'ree@rapid')
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
it "should pull" do
|
|
120
|
+
pull 'deploy.production.rvm.type' => 'user',
|
|
121
|
+
'deploy.production.rvm.ruby' => 'ree',
|
|
122
|
+
'deploy.production.rvm.gemset' => 'rapid'
|
|
123
|
+
|
|
124
|
+
@result['deploy.production.rvm.type'].should == 'user'
|
|
125
|
+
@result['deploy.production.rvm.ruby'].should == 'ree'
|
|
126
|
+
@result['deploy.production.rvm.gemset'].should == 'rapid'
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
describe "deploy.production.scheduler" do
|
|
132
|
+
|
|
133
|
+
it "should push true" do
|
|
134
|
+
push 'deploy.production.bin' => '/foo', 'scheduler' => true
|
|
135
|
+
@result.should include %(set :whenever_command, "/foo/bundle exec whenever")
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
it "should push false" do
|
|
139
|
+
push 'deploy.production.bin' => '/foo', 'scheduler' => false
|
|
140
|
+
@result.should_not include %(set :whenever_command, "/foo/bundle exec whenever")
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
it "should pull true" do
|
|
144
|
+
pull 'deploy.production.bin' => '/foo', 'scheduler' => true
|
|
145
|
+
@result['deploy.production.scheduler'].should == true
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
it "should pull false" do
|
|
149
|
+
pull 'deploy.production.bin' => '/foo', 'scheduler' => false
|
|
150
|
+
@result['deploy.production.scheduler'].should == false
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
end
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/config/deploy.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "deploy.rvm" do
|
|
9
|
+
|
|
10
|
+
it "should push true" do
|
|
11
|
+
push 'deploy.production.rvm' => true
|
|
12
|
+
@result.should include %(require "rvm/capistrano")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should push false" do
|
|
16
|
+
push 'deploy.production.rvm' => false
|
|
17
|
+
@result.should_not include %(require "rvm/capistrano")
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should pull true" do
|
|
21
|
+
pull 'deploy.production.rvm' => true
|
|
22
|
+
@result['deploy.rvm'].should == true
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "should pull false" do
|
|
26
|
+
pull 'deploy.production.rvm' => false
|
|
27
|
+
@result['deploy.rvm'].should == false
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
describe "name" do
|
|
33
|
+
|
|
34
|
+
it "should push" do
|
|
35
|
+
push 'name' => "Hello World"
|
|
36
|
+
@result.should include %(set :application, "Hello World")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should pull" do
|
|
40
|
+
pull 'name' => "Hello World"
|
|
41
|
+
@result['name'].should == "Hello World"
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe "deploy.repository.url" do
|
|
47
|
+
|
|
48
|
+
it "should push" do
|
|
49
|
+
push 'deploy.repository.url' => 'git://foo.git'
|
|
50
|
+
@result.should include %(set :repository, "git://foo.git"\n)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
it "should pull" do
|
|
54
|
+
pull 'deploy.repository.url' => 'git://foo.git'
|
|
55
|
+
@result['deploy.repository.url'].should == 'git://foo.git'
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
describe "deploy.symlink?" do
|
|
61
|
+
|
|
62
|
+
it "should push true" do
|
|
63
|
+
push 'database.sqlite' => true
|
|
64
|
+
@result.should include %(task :symlink_shared)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
it "should push false" do
|
|
68
|
+
push 'database.sqlite' => false
|
|
69
|
+
@result.should_not include %(task :symlink_shared)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it "should pull true" do
|
|
73
|
+
pull 'database.sqlite' => true
|
|
74
|
+
@result['deploy.symlink'].should == true
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
it "should pull false" do
|
|
78
|
+
pull 'database.sqlite' => false
|
|
79
|
+
@result['deploy.symlink'].should == false
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
describe "database.active_record" do
|
|
85
|
+
|
|
86
|
+
it "should push true" do
|
|
87
|
+
push 'database.sqlite' => true
|
|
88
|
+
@result.should include %(/database.yml)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
it "should push false" do
|
|
92
|
+
push 'database.sqlite' => false
|
|
93
|
+
@result.should_not include %(/database.yml)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
it "should pull true" do
|
|
97
|
+
pull 'database.sqlite' => true
|
|
98
|
+
@result['database.active_record'].should == true
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
it "should pull false" do
|
|
102
|
+
pull 'database.sqlite' => false, 'upload.private' => true
|
|
103
|
+
@result['database.active_record'].should == false
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
describe "upload.private" do
|
|
109
|
+
|
|
110
|
+
it "should push true" do
|
|
111
|
+
push 'upload.private' => true
|
|
112
|
+
@result.should include %(/private)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
it "should push false" do
|
|
116
|
+
push 'upload.private' => false
|
|
117
|
+
@result.should_not include %(/private)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
it "should pull true" do
|
|
121
|
+
pull 'upload.private' => true
|
|
122
|
+
@result['upload.private'].should == true
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
it "should pull false" do
|
|
126
|
+
pull 'upload.private' => false
|
|
127
|
+
@result['upload.private'].should == false
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
describe "scheduler" do
|
|
133
|
+
|
|
134
|
+
it "should push true" do
|
|
135
|
+
push 'scheduler' => true
|
|
136
|
+
@result.should include %(require "whenever/capistrano")
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
it "should push false" do
|
|
140
|
+
push 'scheduler' => false
|
|
141
|
+
@result.should_not include %(require "whenever/capistrano")
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
it "should pull true" do
|
|
145
|
+
pull 'scheduler' => true
|
|
146
|
+
@result['scheduler'].should == true
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
it "should pull false" do
|
|
150
|
+
pull 'scheduler' => false
|
|
151
|
+
@result['scheduler'].should == false
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
+
|
|
3
|
+
describe "templates/config/environment.rb" do
|
|
4
|
+
|
|
5
|
+
include Rapid::Spec::Template
|
|
6
|
+
template_spec __FILE__
|
|
7
|
+
|
|
8
|
+
describe "module_name" do
|
|
9
|
+
|
|
10
|
+
it "should push" do
|
|
11
|
+
push 'name' => "hello_world"
|
|
12
|
+
@result.should include %(HelloWorld::Application.initialize!)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "should pull" do
|
|
16
|
+
pull 'name' => "hello_world"
|
|
17
|
+
@result['module_name'].should == "HelloWorld"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|