steak 1.1.0 → 2.0.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. data/{MIT-LICENSE → LICENSE} +1 -1
  2. data/README.md +110 -0
  3. data/lib/generators/steak/install_generator.rb +12 -0
  4. data/lib/generators/steak/spec_generator.rb +11 -0
  5. data/lib/generators/steak/templates/acceptance_spec.rb +13 -0
  6. data/lib/generators/steak/templates/spec/acceptance/acceptance_helper.rb +4 -0
  7. data/lib/generators/steak/templates/spec/acceptance/support/helpers.rb +6 -0
  8. data/lib/{rspec-2/rails/generators/templates → generators/steak/templates/spec/acceptance/support}/paths.rb +1 -1
  9. data/lib/steak.rb +4 -10
  10. data/lib/steak/acceptance_example_group.rb +12 -0
  11. data/lib/steak/railtie.rb +7 -0
  12. data/lib/steak/version.rb +3 -0
  13. data/lib/tasks/steak_tasks.rake +14 -0
  14. data/spec/acceptance/creating_specs_spec.rb +75 -0
  15. data/spec/acceptance/getting_started_spec.rb +33 -0
  16. data/spec/acceptance/rake_support_spec.rb +40 -0
  17. data/spec/fixtures/rails_project/.gitignore +5 -0
  18. data/spec/fixtures/rails_project/Gemfile +55 -0
  19. data/spec/fixtures/rails_project/README +261 -0
  20. data/spec/fixtures/rails_project/Rakefile +7 -0
  21. data/spec/fixtures/rails_project/app/assets/images/rails.png +0 -0
  22. data/spec/fixtures/rails_project/app/assets/javascripts/application.js +9 -0
  23. data/spec/fixtures/rails_project/app/assets/stylesheets/application.css +7 -0
  24. data/spec/fixtures/rails_project/app/controllers/application_controller.rb +3 -0
  25. data/spec/fixtures/rails_project/app/helpers/application_helper.rb +2 -0
  26. data/spec/fixtures/rails_project/app/mailers/.gitkeep +0 -0
  27. data/spec/fixtures/rails_project/app/models/.gitkeep +0 -0
  28. data/spec/fixtures/rails_project/app/views/layouts/application.html.erb +14 -0
  29. data/spec/fixtures/rails_project/config.ru +4 -0
  30. data/spec/fixtures/rails_project/config/application.rb +49 -0
  31. data/spec/fixtures/rails_project/config/boot.rb +6 -0
  32. data/spec/fixtures/rails_project/config/database.yml +48 -0
  33. data/spec/fixtures/rails_project/config/environment.rb +5 -0
  34. data/spec/fixtures/rails_project/config/environments/development.rb +24 -0
  35. data/spec/fixtures/rails_project/config/environments/production.rb +52 -0
  36. data/spec/fixtures/rails_project/config/environments/test.rb +39 -0
  37. data/spec/fixtures/rails_project/config/initializers/backtrace_silencers.rb +7 -0
  38. data/spec/fixtures/rails_project/config/initializers/inflections.rb +10 -0
  39. data/spec/fixtures/rails_project/config/initializers/mime_types.rb +5 -0
  40. data/spec/fixtures/rails_project/config/initializers/secret_token.rb +7 -0
  41. data/spec/fixtures/rails_project/config/initializers/session_store.rb +8 -0
  42. data/spec/fixtures/rails_project/config/initializers/wrap_parameters.rb +12 -0
  43. data/spec/fixtures/rails_project/config/locales/en.yml +5 -0
  44. data/spec/fixtures/rails_project/config/routes.rb +58 -0
  45. data/spec/fixtures/rails_project/db/seeds.rb +7 -0
  46. data/spec/fixtures/rails_project/doc/README_FOR_APP +2 -0
  47. data/spec/fixtures/rails_project/lib/tasks/.gitkeep +0 -0
  48. data/spec/fixtures/rails_project/log/.gitkeep +0 -0
  49. data/spec/fixtures/rails_project/public/404.html +26 -0
  50. data/spec/fixtures/rails_project/public/422.html +26 -0
  51. data/spec/fixtures/rails_project/public/500.html +26 -0
  52. data/spec/fixtures/rails_project/public/favicon.ico +0 -0
  53. data/spec/fixtures/rails_project/public/index.html +241 -0
  54. data/spec/fixtures/rails_project/public/robots.txt +5 -0
  55. data/spec/fixtures/rails_project/script/rails +6 -0
  56. data/spec/fixtures/rails_project/test/fixtures/.gitkeep +0 -0
  57. data/spec/fixtures/rails_project/test/functional/.gitkeep +0 -0
  58. data/spec/fixtures/rails_project/test/integration/.gitkeep +0 -0
  59. data/spec/fixtures/rails_project/test/performance/browsing_test.rb +12 -0
  60. data/spec/fixtures/rails_project/test/test_helper.rb +13 -0
  61. data/spec/fixtures/rails_project/test/unit/.gitkeep +0 -0
  62. data/spec/fixtures/rails_project/vendor/assets/stylesheets/.gitkeep +0 -0
  63. data/spec/fixtures/rails_project/vendor/plugins/.gitkeep +0 -0
  64. data/spec/fixtures/rails_project_with_steak/.gitignore +5 -0
  65. data/spec/fixtures/rails_project_with_steak/.rspec +1 -0
  66. data/spec/fixtures/rails_project_with_steak/Gemfile +58 -0
  67. data/spec/fixtures/rails_project_with_steak/README +261 -0
  68. data/spec/fixtures/rails_project_with_steak/Rakefile +7 -0
  69. data/spec/fixtures/rails_project_with_steak/app/assets/images/rails.png +0 -0
  70. data/spec/fixtures/rails_project_with_steak/app/assets/javascripts/application.js +9 -0
  71. data/spec/fixtures/rails_project_with_steak/app/assets/stylesheets/application.css +7 -0
  72. data/spec/fixtures/rails_project_with_steak/app/controllers/application_controller.rb +3 -0
  73. data/spec/fixtures/rails_project_with_steak/app/helpers/application_helper.rb +2 -0
  74. data/spec/fixtures/rails_project_with_steak/app/mailers/.gitkeep +0 -0
  75. data/spec/fixtures/rails_project_with_steak/app/models/.gitkeep +0 -0
  76. data/spec/fixtures/rails_project_with_steak/app/views/layouts/application.html.erb +14 -0
  77. data/spec/fixtures/rails_project_with_steak/config.ru +4 -0
  78. data/spec/fixtures/rails_project_with_steak/config/application.rb +49 -0
  79. data/spec/fixtures/rails_project_with_steak/config/boot.rb +6 -0
  80. data/spec/fixtures/rails_project_with_steak/config/database.yml +48 -0
  81. data/spec/fixtures/rails_project_with_steak/config/environment.rb +5 -0
  82. data/spec/fixtures/rails_project_with_steak/config/environments/development.rb +24 -0
  83. data/spec/fixtures/rails_project_with_steak/config/environments/production.rb +52 -0
  84. data/spec/fixtures/rails_project_with_steak/config/environments/test.rb +39 -0
  85. data/spec/fixtures/rails_project_with_steak/config/initializers/backtrace_silencers.rb +7 -0
  86. data/spec/fixtures/rails_project_with_steak/config/initializers/inflections.rb +10 -0
  87. data/spec/fixtures/rails_project_with_steak/config/initializers/mime_types.rb +5 -0
  88. data/spec/fixtures/rails_project_with_steak/config/initializers/secret_token.rb +7 -0
  89. data/spec/fixtures/rails_project_with_steak/config/initializers/session_store.rb +8 -0
  90. data/spec/fixtures/rails_project_with_steak/config/initializers/wrap_parameters.rb +12 -0
  91. data/spec/fixtures/rails_project_with_steak/config/locales/en.yml +5 -0
  92. data/spec/fixtures/rails_project_with_steak/config/routes.rb +58 -0
  93. data/spec/fixtures/rails_project_with_steak/db/schema.rb +15 -0
  94. data/spec/fixtures/rails_project_with_steak/db/seeds.rb +7 -0
  95. data/spec/fixtures/rails_project_with_steak/doc/README_FOR_APP +2 -0
  96. data/spec/fixtures/rails_project_with_steak/lib/tasks/.gitkeep +0 -0
  97. data/spec/fixtures/rails_project_with_steak/log/.gitkeep +0 -0
  98. data/spec/fixtures/rails_project_with_steak/public/404.html +26 -0
  99. data/spec/fixtures/rails_project_with_steak/public/422.html +26 -0
  100. data/spec/fixtures/rails_project_with_steak/public/500.html +26 -0
  101. data/spec/fixtures/rails_project_with_steak/public/favicon.ico +0 -0
  102. data/spec/fixtures/rails_project_with_steak/public/index.html +241 -0
  103. data/spec/fixtures/rails_project_with_steak/public/robots.txt +5 -0
  104. data/spec/fixtures/rails_project_with_steak/script/rails +6 -0
  105. data/spec/fixtures/rails_project_with_steak/spec/acceptance/acceptance_helper.rb +4 -0
  106. data/spec/fixtures/rails_project_with_steak/spec/acceptance/support/.gitignore +0 -0
  107. data/spec/fixtures/rails_project_with_steak/spec/acceptance/support/helpers.rb +6 -0
  108. data/{generators/steak/templates → spec/fixtures/rails_project_with_steak/spec/acceptance/support}/paths.rb +1 -1
  109. data/spec/fixtures/rails_project_with_steak/spec/spec_helper.rb +27 -0
  110. data/spec/fixtures/rails_project_with_steak/test/fixtures/.gitkeep +0 -0
  111. data/spec/fixtures/rails_project_with_steak/test/functional/.gitkeep +0 -0
  112. data/spec/fixtures/rails_project_with_steak/test/integration/.gitkeep +0 -0
  113. data/spec/fixtures/rails_project_with_steak/test/performance/browsing_test.rb +12 -0
  114. data/spec/fixtures/rails_project_with_steak/test/test_helper.rb +13 -0
  115. data/spec/fixtures/rails_project_with_steak/test/unit/.gitkeep +0 -0
  116. data/spec/fixtures/rails_project_with_steak/vendor/assets/stylesheets/.gitkeep +0 -0
  117. data/spec/fixtures/rails_project_with_steak/vendor/plugins/.gitkeep +0 -0
  118. data/spec/support/helpers.rb +73 -0
  119. data/spec/support/refresh_fixtures_task.rb +30 -0
  120. metadata +255 -117
  121. data/README.rdoc +0 -193
  122. data/Rakefile +0 -23
  123. data/generators/acceptance_spec/USAGE +0 -1
  124. data/generators/acceptance_spec/acceptance_spec_generator.rb +0 -9
  125. data/generators/acceptance_spec/templates/acceptance_spec.rb +0 -12
  126. data/generators/steak/USAGE +0 -8
  127. data/generators/steak/steak_generator.rb +0 -26
  128. data/generators/steak/templates/acceptance_helper.rb +0 -18
  129. data/generators/steak/templates/helpers.rb +0 -5
  130. data/generators/steak/templates/steak.rake +0 -44
  131. data/lib/rspec-1/steak.rb +0 -17
  132. data/lib/rspec-2/rails/generators/install_generator.rb +0 -31
  133. data/lib/rspec-2/rails/generators/spec_generator.rb +0 -36
  134. data/lib/rspec-2/rails/generators/templates/acceptance_helper.rb +0 -5
  135. data/lib/rspec-2/rails/generators/templates/acceptance_spec.rb +0 -12
  136. data/lib/rspec-2/rails/generators/templates/helpers.rb +0 -5
  137. data/lib/rspec-2/rails/railtie.rb +0 -14
  138. data/lib/rspec-2/rails/tasks/steak.rake +0 -14
  139. data/lib/rspec-2/steak.rb +0 -31
  140. data/spec/acceptance/rspec-1/acceptance_helper.rb +0 -98
  141. data/spec/acceptance/rspec-1/acceptance_spec_generator_spec.rb +0 -44
  142. data/spec/acceptance/rspec-1/basic_spec.rb +0 -76
  143. data/spec/acceptance/rspec-1/rails_spec.rb +0 -39
  144. data/spec/acceptance/rspec-1/steak_generator_spec.rb +0 -96
  145. data/spec/acceptance/rspec-2/acceptance_helper.rb +0 -81
  146. data/spec/acceptance/rspec-2/basic_spec.rb +0 -121
  147. data/spec/acceptance/rspec-2/rails_spec.rb +0 -88
  148. data/spec/acceptance/rspec-2/steak_install_generator_spec.rb +0 -62
  149. data/spec/acceptance/rspec-2/steak_spec_generator_spec.rb +0 -77
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Luismi Cavallé
1
+ Copyright (c) 2009-2011 Luismi Cavallé
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -0,0 +1,110 @@
1
+ ## TODO
2
+ * Rake stats
3
+ * Manual test different scenarios: rspec-rails already present, upgrade from Steak-1…
4
+
5
+ # Steak
6
+
7
+ The delicious combination of RSpec and Capybara for Acceptance BDD
8
+
9
+ ![Steak!!](http://dl.dropbox.com/u/645329/steak_small.jpg "Steak!!")
10
+
11
+ ## What is Steak?
12
+
13
+ Steak is a minimal extension of RSpec-Rails that adds several conveniences to do acceptance testing of Rails applications using Capybara. It's an alternative to Cucumber in plain Ruby. This is how and acceptance spec looks like in Steak:
14
+
15
+ feature 'Main page' do
16
+
17
+ background do
18
+ create_user :login => 'jdoe'
19
+ end
20
+
21
+ scenario 'should show existing quotes' do
22
+ create_quote :text => 'The language of friendship is not words, but meanings',
23
+ :author => 'Henry David Thoreau'
24
+
25
+ login_as 'jdoe'
26
+ visit '/'
27
+
28
+ within('.quote') do
29
+ page.should have_content('The language of friendship is not words, but meanings')
30
+ page.should have_content('Henry David Thoreau')
31
+ end
32
+ end
33
+
34
+ end
35
+
36
+ No givens, whens or thens. No steps, no english, just Ruby. The delicious combination of RSpec and Capybara. That's Steak!
37
+
38
+ ## Why Steak?
39
+
40
+ If, after all, this is just RSpec + Capybara, why does Steak even exist? Do I really need it?
41
+
42
+ Basically Steak exists for three reasons:
43
+
44
+ 1. **Making a point**. First of all, Steak proposes that using RSpec and Capybara for acceptance testing is a sensible alternative to Cucumber. It also sets a name to refer to that approach.
45
+ 1. **Adding convenience**. As a gem, Steak aims to make the experience as convenient as possible. It provides Rails integration testing support and several generators and rake tasks so that setting up a new project or creating and running specs are quick and seamless tasks. A natural extension of RSpec-Rails.
46
+ 1. **Building a community**. No development approach or ruby gem is really valuable without an active community behind it. The mailing list, the IRC channel, the wiki or the twitter account are useful tools to build a community of users that help each other by sharing knowledge, resources and best practices.
47
+
48
+ ## Getting Started
49
+
50
+ _NOTE: The latest version of Steak assumes that you're testing a Rails 3 application, with RSpec 2 and Capybara. For Rails 2, RSpec 1 or Webrat you should use Steak 1.x (or consider upgrading to non-obsolete technologies ;P)_
51
+
52
+ It's super-easy to get you started. Just add the gem to your `Gemfile`…
53
+
54
+ group :test, :development do
55
+ gem 'steak'
56
+ # ...
57
+
58
+ …and then install the gem and run the generator:
59
+
60
+ $ bundle
61
+ $ rails g steak:install
62
+
63
+ You're now set up! Take a look at the default directory structure you've got under `spec/acceptance`. It will help you organize the helpers and configurations for your acceptance specs.
64
+
65
+ Note that Steak is the only dependency you really need, you can safely remove any reference to `capybara`, `rspec-rails` or `rspec` from your `Gemfile`, they will be included by Steak. Also note that, unless previously executed, Steak will run the RSpec generator so you don't need to invoke it.
66
+
67
+ ## Creating and running specs
68
+
69
+ You can create your specs by hand, however you may prefer to use the generator:
70
+
71
+ $ rails g steak:spec my_first_feature
72
+
73
+ To run your acceptance specs you just do like with any other spec…
74
+
75
+ $ rspec spec/acceptance/my_first_feature_spec.rb
76
+
77
+ …or using rake:
78
+
79
+ $ rake spec:acceptance
80
+
81
+ ## Resources
82
+
83
+ * [Source code](http://github.com/cavalle/steak) – Lurking and forking
84
+ * [Issues](http://github.com/cavalle/steak/issues) – Bugs and feature requests
85
+ * [Google Group](http://groups.google.com/group/steakrb) & [IRC channel](irc://irc.freenode.net/jenkinsci) – Help and discussion
86
+ * [Twitter](http://twitter.com/steakrb) – Announcements and mentions
87
+ * [Wiki](https://github.com/cavalle/steak/wiki) – Tutorials, docs and other resources
88
+
89
+ ## Credits
90
+
91
+ Steak was created by [Luismi Cavallé](http://lmcavalle.com) and improved thanks to the love from:
92
+
93
+ * Álvaro Bautista
94
+ * Felipe Talavera
95
+ * Paco Guzmán
96
+ * Jeff Kreeftmeijer
97
+ * Jaime Iniesta
98
+ * Emili Parreño
99
+ * Andreas Wolff
100
+ * Wincent Colaiuta
101
+ * Falk Pauser
102
+ * Francesc Esplugas
103
+ * Raúl Murciano
104
+ * Enable Interactive
105
+ * Vojto Rinik
106
+ * Fred Wu
107
+ * Sergio Espeja
108
+ * Joao Carlos
109
+
110
+ Copyright © 2009 - 2011 Luismi Cavallé, released under the MIT license
@@ -0,0 +1,12 @@
1
+ module Steak
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.join(File.dirname(__FILE__), 'templates')
5
+
6
+ def main
7
+ generate 'rspec:install'
8
+ directory 'spec/acceptance'
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Steak
2
+ module Generators
3
+ class SpecGenerator < Rails::Generators::NamedBase
4
+ source_root File.join(File.dirname(__FILE__), 'templates')
5
+
6
+ def main
7
+ template 'acceptance_spec.rb', File.join('spec/acceptance', class_path, "#{file_name}_spec.rb")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ require 'acceptance/acceptance_helper'
2
+
3
+ feature '<%= human_name %>', %q{
4
+ In order to ...
5
+ As a ...
6
+ I want ...
7
+ } do
8
+
9
+ scenario 'first scenario' do
10
+ true.should == true
11
+ end
12
+
13
+ end
@@ -0,0 +1,4 @@
1
+ require 'spec_helper'
2
+
3
+ # Put your acceptance spec helpers inside spec/acceptance/support
4
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -0,0 +1,6 @@
1
+ module HelperMethods
2
+ # Put helper methods you need to be available in all acceptance specs here.
3
+
4
+ end
5
+
6
+ RSpec.configuration.include HelperMethods, :type => :acceptance
@@ -6,4 +6,4 @@ module NavigationHelpers
6
6
  end
7
7
  end
8
8
 
9
- RSpec.configuration.include NavigationHelpers, :type => :acceptance
9
+ RSpec.configuration.include NavigationHelpers, :type => :acceptance
@@ -1,11 +1,5 @@
1
- begin
2
- require 'rspec/core'
3
- rescue LoadError
4
- require 'spec'
5
- end
1
+ require 'capybara/rspec'
2
+ require 'rspec-rails'
6
3
 
7
- if defined?(RSpec::Core)
8
- require 'rspec-2/steak'
9
- else
10
- require 'rspec-1/steak'
11
- end
4
+ require 'steak/railtie'
5
+ require 'steak/acceptance_example_group'
@@ -0,0 +1,12 @@
1
+ module Steak
2
+ module AcceptanceExampleGroup
3
+ extend ActiveSupport::Concern
4
+
5
+ included do
6
+ include RSpec::Rails::RequestExampleGroup
7
+ metadata[:type] = :acceptance
8
+ end
9
+ end
10
+ end
11
+
12
+ RSpec.configuration.include Steak::AcceptanceExampleGroup, :capybara_feature => true
@@ -0,0 +1,7 @@
1
+ module Steak
2
+ class Railtie < ::Rails::Railtie
3
+ rake_tasks do
4
+ load 'tasks/steak_tasks.rake'
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ module Steak
2
+ VERSION = '2.0.0.beta1'
3
+ end
@@ -0,0 +1,14 @@
1
+ namespace :spec do
2
+ desc 'Run the acceptance specs in spec/acceptance'
3
+ RSpec::Core::RakeTask.new(:acceptance => 'db:test:prepare') do |t|
4
+ t.pattern = 'spec/acceptance/**/*_spec.rb'
5
+ end
6
+
7
+ task :statsetup do
8
+ if File.exist?('spec/acceptance')
9
+ require 'rails/code_statistics'
10
+ ::STATS_DIRECTORIES << ['Acceptance specs', 'spec/acceptance']
11
+ ::CodeStatistics::TEST_TYPES << 'Acceptance specs'
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,75 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Creating acceptance specs', %q{
4
+ In order to not having to do it manually
5
+ As a lazy Rails developer
6
+ I want empty new specs to be generated for me
7
+ } do
8
+
9
+ scenario 'using the spec generator' do
10
+ new_project_from :rails_project_with_steak
11
+
12
+ run 'rails g steak:spec my_first_feature'
13
+
14
+ path('spec/acceptance/my_first_feature_spec.rb').should exist
15
+ content_of('spec/acceptance/my_first_feature_spec.rb').should include("require 'acceptance/acceptance_helper'")
16
+ content_of('spec/acceptance/my_first_feature_spec.rb').should include("feature 'My first feature'")
17
+
18
+ run 'rspec spec/acceptance/my_first_feature_spec.rb'
19
+
20
+ output.should =~ /1 example, 0 failures/
21
+ end
22
+
23
+ scenario 'under a subdirectory' do
24
+ new_project_from :rails_project_with_steak
25
+
26
+ run 'rails g steak:spec subdir/my_first_feature'
27
+
28
+ content_of('spec/acceptance/subdir/my_first_feature_spec.rb').should include("feature 'My first feature'")
29
+
30
+ run 'rspec spec/acceptance/subdir/my_first_feature_spec.rb'
31
+
32
+ output.should =~ /1 example, 0 failures/
33
+ end
34
+
35
+ scenario 'with Capybara and paths' do
36
+ new_project_from :rails_project_with_steak
37
+
38
+ create_file 'spec/acceptance/capybara_spec.rb', <<-RSPEC
39
+ require 'acceptance/acceptance_helper'
40
+
41
+ feature 'Capybara and paths' do
42
+ scenario 'should visit homepage' do
43
+ visit homepage
44
+
45
+ page.should have_content("Ruby on Rails: Welcome aboard")
46
+ end
47
+ end
48
+ RSPEC
49
+
50
+ run 'rspec spec/acceptance/capybara_spec.rb'
51
+
52
+ output.should =~ /1 example, 0 failures/
53
+ end
54
+
55
+ scenario 'with Rails integration testing support' do
56
+ new_project_from :rails_project_with_steak
57
+
58
+ create_file 'spec/acceptance/integration_spec.rb', <<-RSPEC
59
+ require 'acceptance/acceptance_helper'
60
+
61
+ feature 'Capybara and paths' do
62
+ scenario 'should visit homepage' do
63
+ get '/'
64
+
65
+ status.should == 200
66
+ end
67
+ end
68
+ RSPEC
69
+
70
+ run 'rspec spec/acceptance/integration_spec.rb'
71
+
72
+ output.should =~ /1 example, 0 failures/
73
+ end
74
+
75
+ end
@@ -0,0 +1,33 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Getting started', %q{
4
+ In order to start coding my awesome new project
5
+ As a Rails developer
6
+ I want set up my project for Acceptance BDD
7
+ } do
8
+
9
+ scenario 'from an empty Rails project' do
10
+ new_project_from :rails_project
11
+
12
+ append_to 'Gemfile', <<-GEMS
13
+ group :test, :development do
14
+ gem 'steak', :path => '#{root_path}'
15
+ end
16
+ GEMS
17
+
18
+ run 'bundle --local'
19
+ run 'rails g steak:install'
20
+
21
+ # rspec-rails should be present
22
+ path('spec').should exist
23
+ path('spec/spec_helper.rb').should exist
24
+
25
+ # steak should be present
26
+ path('spec/acceptance').should exist
27
+ path('spec/acceptance/acceptance_helper.rb').should exist
28
+ path('spec/acceptance/support').should exist
29
+ path('spec/acceptance/support/helpers.rb').should exist
30
+ path('spec/acceptance/support/paths.rb').should exist
31
+ end
32
+
33
+ end
@@ -0,0 +1,40 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Rake support', %q{
4
+ In order to conveniently run my specs along with the rest of my test suite
5
+ As a Rails developer
6
+ I want rake support in Steak
7
+ } do
8
+
9
+ background do
10
+ new_project_from :rails_project_with_steak
11
+ create_file 'spec/models/model_spec.rb', <<-RSPEC
12
+ require 'spec_helper'
13
+
14
+ describe Object do
15
+ it { should respond_to :to_s }
16
+ end
17
+ RSPEC
18
+ run 'rails g steak:spec my_spec'
19
+ end
20
+
21
+ scenario 'to run acceptance specs as part of the test suite' do
22
+ run 'rake spec'
23
+ output.should =~ /2 examples, 0 failures/
24
+
25
+ run 'rake'
26
+ output.should =~ /2 examples, 0 failures/
27
+ end
28
+
29
+ scenario 'to run only acceptance specs' do
30
+ run 'rake spec:acceptance'
31
+ output.should =~ /1 example, 0 failures/
32
+ end
33
+
34
+ scenario "to get stats" do
35
+ run 'rake stats'
36
+ output.should =~ /Model specs \D+ 5 /
37
+ output.should =~ /Acceptance specs \D+ [1-9]+ /
38
+ end
39
+
40
+ end
@@ -0,0 +1,5 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/
5
+ .sass-cache/
@@ -0,0 +1,55 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.1.0.rc1'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+ platforms :ruby do
9
+ gem 'sqlite3'
10
+ end
11
+
12
+ platforms :jruby do
13
+ gem 'activerecord-jdbc-adapter'
14
+
15
+ # As rails --database switch does not support derby, hsqldb, h2 nor mssql
16
+ # as valid values, if you are not using SQLite, comment out the SQLite gem
17
+ # below and uncomment the gem declaration for the adapter you are using.
18
+ # If you are using oracle, db2, sybase, informix or prefer to use the plain
19
+ # JDBC adapter, comment out all the adapter gems below.
20
+
21
+ # SQLite JDBC adapter
22
+ gem 'jdbc-sqlite3', :require => false
23
+
24
+ # Derby JDBC adapter
25
+ #gem 'activerecord-jdbcderby-adapter'
26
+
27
+ # HSQL JDBC adapter
28
+ #gem 'activerecord-jdbchsqldb-adapter'
29
+
30
+ # H2 JDBC adapter
31
+ #gem 'activerecord-jdbch2-adapter'
32
+
33
+ # SQL Server JDBC adapter
34
+ #gem 'activerecord-jdbcmssql-adapter'
35
+
36
+ end
37
+
38
+
39
+ # Asset template engines
40
+ gem 'json'
41
+ gem 'sass'
42
+ gem 'coffee-script'
43
+ gem 'uglifier'
44
+
45
+ gem 'jquery-rails'
46
+
47
+ # Use unicorn as the web server
48
+ # gem 'unicorn'
49
+
50
+ # Deploy with Capistrano
51
+ # gem 'capistrano'
52
+
53
+ # To use debugger
54
+ # gem 'ruby-debug'
55
+