da-suspenders 1.0.3 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -4
- data/CHANGELOG.md +39 -30
- data/LICENSE +21 -21
- data/README.md +64 -66
- data/Rakefile +41 -40
- data/bin/da-suspenders +1 -1
- data/da-suspenders.gemspec +26 -26
- data/features/running_cucumber.feature +17 -17
- data/features/step_definitions/shell.rb +30 -30
- data/features/support/env.rb +0 -1
- data/lib/create.rb +57 -55
- data/lib/da-suspenders/version.rb +2 -2
- data/lib/errors.rb +12 -12
- data/template/da-suspenders.rb +159 -172
- data/template/files/factory_girl_steps.rb +1 -1
- data/template/files/mysql_database.yml.erb +39 -39
- data/template/trout/Gemfile +66 -43
- data/template/trout/app/assets/javascripts/application.js.coffee +10 -0
- data/template/trout/app/assets/stylesheets/application.css.scss +16 -0
- data/template/trout/app/assets/stylesheets/ie6.css.scss +4 -0
- data/template/trout/app/assets/stylesheets/ie7.css.scss +4 -0
- data/template/trout/app/helpers/body_class_helper.rb +6 -6
- data/template/trout/app/views/layouts/application.html.erb +16 -15
- data/template/trout/app/views/shared/_flashes.html.erb +5 -5
- data/template/trout/config/initializers/errors.rb +26 -26
- data/template/trout/config/initializers/will_paginate.rb +3 -3
- data/template/trout/config/locales/de.yml +54 -11
- data/template/trout/features/step_definitions/js_steps.rb +3 -3
- data/template/trout/vendor/assets/javascripts/jquery-ui-1.8.16.js +791 -0
- data/template/trout/vendor/{sprockets/modernizr/src → assets/javascripts}/modernizr.js +29 -29
- metadata +12 -14
- data/template/trout/app/javascripts/application.js +0 -10
- data/template/trout/app/stylesheets/application.scss +0 -14
- data/template/trout/app/stylesheets/ie.scss +0 -2
- data/template/trout/lib/templates/erb/scaffold/_form.html.erb +0 -13
- data/template/trout/vendor/sprockets/jquery-ujs/src/rails.js +0 -169
data/.gitignore
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
*.swp
|
2
|
-
pkg
|
3
|
-
test_project
|
4
|
-
.rake_tasks
|
1
|
+
*.swp
|
2
|
+
pkg
|
3
|
+
test_project
|
4
|
+
.rake_tasks
|
5
|
+
.DS_Store
|
data/CHANGELOG.md
CHANGED
@@ -1,31 +1,40 @@
|
|
1
|
-
## 1.0
|
2
|
-
|
3
|
-
###
|
4
|
-
*
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
* Explicit dependency on
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
*
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
1
|
+
## 1.1.0 (2011-10-12)
|
2
|
+
|
3
|
+
### New / Changed
|
4
|
+
* Updated to use Rails 3.1.1:
|
5
|
+
** Removed sprockets and jrails (no longer needed)
|
6
|
+
* ie6.css and ie7.css instead of only one common ie.css (inspired by Formtastic)
|
7
|
+
* Switched from Hoptoad Notifier to Airbrake.
|
8
|
+
* Pass in REPO to specify the da-suspenders repo (defaults to local dir for testing).
|
9
|
+
|
10
|
+
## 1.0.3 (2011-06-10)
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
* Explicit dependency on Rails 3.0.7 in gemspec.
|
14
|
+
|
15
|
+
|
16
|
+
## 1.0.2 (2011-06-10)
|
17
|
+
|
18
|
+
### New / Changed
|
19
|
+
* Additional entries in Gemfile (all commented out by default): Devise, CanCan, CarrierWave, RMagick.
|
20
|
+
* Localized labels for will_paginate.
|
21
|
+
* Updated gems: Rails (3.0.7), Compass (0.11.1), Formtastic (1.2.3).
|
22
|
+
* Explicit dependency on rake 0.8.7 (to avoid problems with rake 0.9.x).
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
* Fixed missing version requirement for will_paginate.
|
26
|
+
|
27
|
+
|
28
|
+
## 1.0.1 (2011-02-16)
|
29
|
+
|
30
|
+
### New / Changed
|
31
|
+
* Timestamped migrations are now disabled per default.
|
32
|
+
* Inject code into `features/support/paths.rb` (generated by Cucumber) to enable literal paths like `/foo/bar/2` in web steps.
|
33
|
+
|
34
|
+
### Fixed
|
35
|
+
* Fixed link to the internet explorer stylesheet (generated by Sass) in `app/views/layouts/application.html.erb`.
|
36
|
+
* Fixed deprecation warnings because of <% %> style block helpers.
|
37
|
+
|
38
|
+
|
39
|
+
## 1.0.0 (2011-02-14)
|
31
40
|
* Initial Release
|
data/LICENSE
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
The MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2010 Mike Burns
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
1
|
+
The MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2010 Mike Burns
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,66 +1,64 @@
|
|
1
|
-
DA-Suspenders is a base Rails application that you can upgrade.
|
2
|
-
|
3
|
-
This is a fork of [thoughtbot's original Suspenders](https://github.com/thoughtbot/suspenders/), customized to our needs.
|
4
|
-
|
5
|
-
|
6
|
-
## Installation
|
7
|
-
|
8
|
-
First install the da-suspenders gem:
|
9
|
-
|
10
|
-
gem install da-suspenders
|
11
|
-
|
12
|
-
Then run:
|
13
|
-
|
14
|
-
da-suspenders create projectname
|
15
|
-
|
16
|
-
This will create a Rails 3 app in `projectname'. This script creates a new git repository. It is not meant to be used against an existing repo.
|
17
|
-
|
18
|
-
Suspenders uses [Trout](https://github.com/thoughtbot/trout) to make it easier to maintain a base version of special files (like Gemfile) in Suspenders.
|
19
|
-
|
20
|
-
Whenever you want to get the latest and greatest Suspenders' Gemfile, run:
|
21
|
-
|
22
|
-
trout update Gemfile
|
23
|
-
|
24
|
-
|
25
|
-
## Gemfile
|
26
|
-
|
27
|
-
To see the latest and greatest gems, look at DA-Suspenders'
|
28
|
-
[template/trout/Gemfile](https://github.com/die-antwort/da-suspenders/blob/master/template/trout/Gemfile), which will be copied into your projectname/Gemfile.
|
29
|
-
|
30
|
-
It includes application gems like:
|
31
|
-
|
32
|
-
* [Compass](https://github.com/chriseppstein/compass), a [Sass-based](http://sass-lang.com/) CSS Meta-Framework
|
33
|
-
* [
|
34
|
-
* [
|
35
|
-
*
|
36
|
-
* [
|
37
|
-
* [
|
38
|
-
* [
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
* [
|
45
|
-
* [
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
*
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
DA-Suspenders is created by [DIE ANTWORT](http://www.die-antwort.eu), based on Suspenders created and funded by [thoughtbot, inc](http://thoughtbot.com/community).
|
1
|
+
DA-Suspenders is a base Rails application that you can upgrade.
|
2
|
+
|
3
|
+
This is a fork of [thoughtbot's original Suspenders](https://github.com/thoughtbot/suspenders/), customized to our needs.
|
4
|
+
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
First install the da-suspenders gem:
|
9
|
+
|
10
|
+
gem install da-suspenders
|
11
|
+
|
12
|
+
Then run:
|
13
|
+
|
14
|
+
da-suspenders create projectname
|
15
|
+
|
16
|
+
This will create a Rails 3 app in `projectname'. This script creates a new git repository. It is not meant to be used against an existing repo.
|
17
|
+
|
18
|
+
Suspenders uses [Trout](https://github.com/thoughtbot/trout) to make it easier to maintain a base version of special files (like Gemfile) in Suspenders.
|
19
|
+
|
20
|
+
Whenever you want to get the latest and greatest Suspenders' Gemfile, run:
|
21
|
+
|
22
|
+
trout update Gemfile
|
23
|
+
|
24
|
+
|
25
|
+
## Gemfile
|
26
|
+
|
27
|
+
To see the latest and greatest gems, look at DA-Suspenders'
|
28
|
+
[template/trout/Gemfile](https://github.com/die-antwort/da-suspenders/blob/master/template/trout/Gemfile), which will be copied into your projectname/Gemfile.
|
29
|
+
|
30
|
+
It includes application gems like:
|
31
|
+
|
32
|
+
* [Compass](https://github.com/chriseppstein/compass), a [Sass-based](http://sass-lang.com/) CSS Meta-Framework
|
33
|
+
* [will_paginate](https://github.com/mislav/will_paginate/wiki/) for easy pagination
|
34
|
+
* [Paperclip](https://github.com/thoughtbot/paperclip) or [CarrierWave](https://github.com/jnicklas/carrierwave) for file uploads
|
35
|
+
* [Formtastic](https://github.com/justinfrench/formtastic) for better forms
|
36
|
+
* [Devise](https://github.com/plataformatec/devise) and [CanCan](https://github.com/ryanb/cancan) for authentication and authorization
|
37
|
+
* [AppConfig](https://github.com/die-antwort/app_config) for simple application configuration
|
38
|
+
* [Airbrake](https://github.com/thoughtbot/airbrake) for exception notification
|
39
|
+
|
40
|
+
And testing gems like:
|
41
|
+
|
42
|
+
* [Cucumber, Capybara, and Akephalos](http://robots.thoughtbot.com/post/1658763359/thoughtbot-and-the-holy-grail) for integration testing, including Javascript behavior
|
43
|
+
* [RSpec](https://github.com/rspec/rspec) for awesome, readable isolation testing
|
44
|
+
* [Factory Girl](https://github.com/thoughtbot/factory_girl) for easier creation of test data
|
45
|
+
* [Timecop](https://github.com/jtrupiano/timecop) for dealing with time
|
46
|
+
|
47
|
+
Some gems are commented out by default in the Gemfile – just uncomment the ones you want to use.
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
## Other goodies
|
52
|
+
|
53
|
+
DA-Suspenders also comes with:
|
54
|
+
|
55
|
+
* Additional staging environment.
|
56
|
+
* German localization and timezone setting.
|
57
|
+
* Rails' flashes set up and in application layout.
|
58
|
+
|
59
|
+
See [template/files](https://github.com/die-antwort/da-suspenders/blob/master/template/trout) to see what is installed via Trout.
|
60
|
+
|
61
|
+
|
62
|
+
## Credits
|
63
|
+
|
64
|
+
DA-Suspenders is created by [DIE ANTWORT](http://www.die-antwort.eu), based on Suspenders created and funded by [thoughtbot, inc](http://thoughtbot.com/community).
|
data/Rakefile
CHANGED
@@ -1,40 +1,41 @@
|
|
1
|
-
require "bundler"
|
2
|
-
require "cucumber/rake/task"
|
3
|
-
|
4
|
-
Bundler::GemHelper.install_tasks
|
5
|
-
|
6
|
-
#############################################################################
|
7
|
-
#
|
8
|
-
# Testing functions
|
9
|
-
#
|
10
|
-
#############################################################################
|
11
|
-
|
12
|
-
Cucumber::Rake::Task.new
|
13
|
-
|
14
|
-
TEST_PROJECT = "test_project"
|
15
|
-
|
16
|
-
namespace :test do
|
17
|
-
desc "A full suspenders app's test suite"
|
18
|
-
task :full => ['test_project:generate', 'cucumber', 'test_project:destroy']
|
19
|
-
end
|
20
|
-
|
21
|
-
namespace :test_project do
|
22
|
-
desc 'Suspend a new project. Pass REPO=... to change the Suspenders repo.'
|
23
|
-
task :generate do
|
24
|
-
FileUtils.rm_rf(TEST_PROJECT)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
sh "rake db:drop RAILS_ENV=
|
33
|
-
|
34
|
-
FileUtils.
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
1
|
+
require "bundler"
|
2
|
+
require "cucumber/rake/task"
|
3
|
+
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
|
6
|
+
#############################################################################
|
7
|
+
#
|
8
|
+
# Testing functions
|
9
|
+
#
|
10
|
+
#############################################################################
|
11
|
+
|
12
|
+
Cucumber::Rake::Task.new
|
13
|
+
|
14
|
+
TEST_PROJECT = "test_project"
|
15
|
+
|
16
|
+
namespace :test do
|
17
|
+
desc "A full suspenders app's test suite"
|
18
|
+
task :full => ['test_project:generate', 'cucumber', 'test_project:destroy']
|
19
|
+
end
|
20
|
+
|
21
|
+
namespace :test_project do
|
22
|
+
desc 'Suspend a new project. Pass REPO=... to change the Suspenders repo (defaults to dir with Rakefile).'
|
23
|
+
task :generate do
|
24
|
+
FileUtils.rm_rf(TEST_PROJECT)
|
25
|
+
repo = (ENV['REPO'] || "file://#{Dir.pwd}").to_s
|
26
|
+
sh 'ruby', 'bin/da-suspenders', 'create', TEST_PROJECT, repo
|
27
|
+
end
|
28
|
+
|
29
|
+
desc 'Remove a suspended project'
|
30
|
+
task :destroy do
|
31
|
+
FileUtils.cd TEST_PROJECT
|
32
|
+
sh "rake db:drop RAILS_ENV=development"
|
33
|
+
sh "rake db:drop RAILS_ENV=test"
|
34
|
+
FileUtils.cd '..'
|
35
|
+
FileUtils.rm_rf TEST_PROJECT
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'Run the test suite'
|
40
|
+
task :default => ['test:full']
|
41
|
+
|
data/bin/da-suspenders
CHANGED
data/da-suspenders.gemspec
CHANGED
@@ -1,26 +1,26 @@
|
|
1
|
-
require File.expand_path("../lib/da-suspenders/version", __FILE__)
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.name = 'da-suspenders'
|
5
|
-
s.version = DaSuspenders::VERSION
|
6
|
-
s.platform = Gem::Platform::RUBY
|
7
|
-
s.authors = ["thoughtbot", "Stefan Daschek"]
|
8
|
-
s.email = 'stefan@die-antwort.eu'
|
9
|
-
s.homepage = 'http://github.com/die-antwort/da-suspenders'
|
10
|
-
s.summary = "Generate a Rails app using DIE ANTWORT's best practices."
|
11
|
-
s.description = "DIE ANTWORT's fork of thoughtbot's original Suspenders. Suspenders is an upgradeable base Rails project."
|
12
|
-
|
13
|
-
s.required_rubygems_version = ">= 1.3.6"
|
14
|
-
|
15
|
-
s.add_dependency('rails', '3.0.7')
|
16
|
-
s.add_dependency('bundler', '~> 1.0.10')
|
17
|
-
s.add_dependency('trout', '~> 0.3')
|
18
|
-
|
19
|
-
s.files = `git ls-files`.split("\n")
|
20
|
-
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
21
|
-
s.test_files = s.files.select{ |path| path =~ /^features/ }
|
22
|
-
s.require_path = 'lib'
|
23
|
-
|
24
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
25
|
-
s.extra_rdoc_files = %w[README.md LICENSE]
|
26
|
-
end
|
1
|
+
require File.expand_path("../lib/da-suspenders/version", __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = 'da-suspenders'
|
5
|
+
s.version = DaSuspenders::VERSION
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.authors = ["thoughtbot", "Stefan Daschek"]
|
8
|
+
s.email = 'stefan@die-antwort.eu'
|
9
|
+
s.homepage = 'http://github.com/die-antwort/da-suspenders'
|
10
|
+
s.summary = "Generate a Rails app using DIE ANTWORT's best practices."
|
11
|
+
s.description = "DIE ANTWORT's fork of thoughtbot's original Suspenders. Suspenders is an upgradeable base Rails project."
|
12
|
+
|
13
|
+
s.required_rubygems_version = ">= 1.3.6"
|
14
|
+
|
15
|
+
s.add_dependency('rails', '3.0.7')
|
16
|
+
s.add_dependency('bundler', '~> 1.0.10')
|
17
|
+
s.add_dependency('trout', '~> 0.3')
|
18
|
+
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
21
|
+
s.test_files = s.files.select{ |path| path =~ /^features/ }
|
22
|
+
s.require_path = 'lib'
|
23
|
+
|
24
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
25
|
+
s.extra_rdoc_files = %w[README.md LICENSE]
|
26
|
+
end
|
@@ -1,18 +1,18 @@
|
|
1
|
-
Feature: Running cucumber in the generated project
|
2
|
-
|
3
|
-
Scenario: jQuery and Modernizr work in the generated project
|
4
|
-
Given I drop and create the required databases
|
5
|
-
And I generate "scaffold user username:string"
|
6
|
-
And I run the rake task "db:migrate"
|
7
|
-
And I create a file named "features/js_test.feature" with:
|
8
|
-
"""
|
9
|
-
Feature: Javascript
|
10
|
-
@javascript
|
11
|
-
Scenario: Test jQuery and Modernizr
|
12
|
-
When I go to "the users page"
|
13
|
-
Then the javascript expression "$('html').hasClass('js')" should return "true"
|
14
|
-
And the javascript expression "$('html').hasClass('no-js')" should return "false"
|
15
|
-
"""
|
16
|
-
When I run the rake task "cucumber"
|
17
|
-
Then I see a successful response in the shell
|
1
|
+
Feature: Running cucumber in the generated project
|
2
|
+
|
3
|
+
Scenario: jQuery and Modernizr work in the generated project
|
4
|
+
Given I drop and create the required databases
|
5
|
+
And I generate "scaffold user username:string"
|
6
|
+
And I run the rake task "db:migrate"
|
7
|
+
And I create a file named "features/js_test.feature" with:
|
8
|
+
"""
|
9
|
+
Feature: Javascript
|
10
|
+
@javascript
|
11
|
+
Scenario: Test jQuery and Modernizr
|
12
|
+
When I go to "the users page"
|
13
|
+
Then the javascript expression "$('html').hasClass('js')" should return "true"
|
14
|
+
And the javascript expression "$('html').hasClass('no-js')" should return "false"
|
15
|
+
"""
|
16
|
+
When I run the rake task "cucumber"
|
17
|
+
Then I see a successful response in the shell
|
18
18
|
|
@@ -1,30 +1,30 @@
|
|
1
|
-
When 'I run the rake task "$task_name"' do |task_name|
|
2
|
-
Dir.chdir('test_project') do
|
3
|
-
system("rake #{task_name}")
|
4
|
-
end
|
5
|
-
end
|
6
|
-
|
7
|
-
When 'I generate "$generator_with_args"' do |generator_with_args|
|
8
|
-
Dir.chdir('test_project') do
|
9
|
-
system("rails generate #{generator_with_args}")
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
When 'I create a file named "$filename" with:' do |filename, content|
|
14
|
-
File.open("test_project/#{filename}", "w") do |file|
|
15
|
-
file.write(content)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
Then 'I see a successful response in the shell' do
|
20
|
-
$?.to_i.should == 0
|
21
|
-
end
|
22
|
-
|
23
|
-
When 'I drop and create the required databases' do
|
24
|
-
Dir.chdir('test_project') do
|
25
|
-
system("rake db:drop RAILS_ENV=test")
|
26
|
-
system("rake db:drop")
|
27
|
-
system("rake db:create RAILS_ENV=test")
|
28
|
-
system("rake db:create")
|
29
|
-
end
|
30
|
-
end
|
1
|
+
When 'I run the rake task "$task_name"' do |task_name|
|
2
|
+
Dir.chdir('test_project') do
|
3
|
+
system("rake #{task_name}")
|
4
|
+
end
|
5
|
+
end
|
6
|
+
|
7
|
+
When 'I generate "$generator_with_args"' do |generator_with_args|
|
8
|
+
Dir.chdir('test_project') do
|
9
|
+
system("rails generate #{generator_with_args}")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
When 'I create a file named "$filename" with:' do |filename, content|
|
14
|
+
File.open("test_project/#{filename}", "w") do |file|
|
15
|
+
file.write(content)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
Then 'I see a successful response in the shell' do
|
20
|
+
$?.to_i.should == 0
|
21
|
+
end
|
22
|
+
|
23
|
+
When 'I drop and create the required databases' do
|
24
|
+
Dir.chdir('test_project') do
|
25
|
+
system("rake db:drop RAILS_ENV=test")
|
26
|
+
system("rake db:drop")
|
27
|
+
system("rake db:create RAILS_ENV=test")
|
28
|
+
system("rake db:create")
|
29
|
+
end
|
30
|
+
end
|