steak 0.3.8 → 0.4.0.a1

Sign up to get free protection for your applications and to get access to all the features.
@@ -40,15 +40,15 @@ If you are not in Rails but use RSpec, then Steak is just some aliases providing
40
40
 
41
41
  Just install and require the damned gem!
42
42
 
43
- $ gem install steak
43
+ $ [sudo] gem install steak
44
44
 
45
45
  Then in your spec or spec helper:
46
46
 
47
47
  require 'steak'
48
48
 
49
49
  That's all. You don't really need to require RSpec.
50
-
51
- === In Rails 2.x (stable branch)
50
+
51
+ === In Rails
52
52
 
53
53
  Assuming you have already setup rspec-rails, add this to your project's <tt>config/environments/test.rb</tt>:
54
54
 
@@ -56,17 +56,13 @@ Assuming you have already setup rspec-rails, add this to your project's <tt>conf
56
56
 
57
57
  Install the gem from the command line:
58
58
 
59
- $ RAILS_ENV=test rake gems:install
59
+ $ [sudo] RAILS_ENV=test rake gems:install
60
60
 
61
61
  Run the generator:
62
62
 
63
63
  $ script/generate steak
64
-
65
- That will create some basic helper files and directory structure under the +spec/acceptance+ directory, already configured for +Capybara+. If you want to use +Webrat+, just pass it to the generator:
66
-
67
- $ script/generate steak --webrat
68
64
 
69
- Spend one minute on getting familiar with the structure and files you've got.
65
+ That will create some basic helper files and directory structure under the +spec/acceptance+ directory, already configured for +Webrat+. Spend one minute on getting familiar with the structure and files you've got.
70
66
 
71
67
  Now you may want to create your first acceptance spec:
72
68
 
@@ -84,61 +80,8 @@ You run your acceptance specs just like your regular specs. Individually...
84
80
 
85
81
  $ rake spec:acceptance
86
82
 
87
- === In Rails 3 (master branch)
88
-
89
- Add this to your project's <tt>Gemfile</tt>:
90
-
91
- gem 'steak', '>= 0.4.0.a5'
92
-
93
- And install it:
94
-
95
- $ bundle install
96
-
97
- Run the generator:
98
-
99
- $ rails generate steak
100
-
101
- That will create some basic helper files and directory structure under the +spec/acceptance+ directory, already configured for +Capybara+. If you want to use +Webrat+, just pass it to the generator:
102
-
103
- $ rails generate steak --webrat
104
-
105
- Spend one minute on getting familiar with the structure and files you've got.
106
-
107
- Now you may want to create your first acceptance spec:
108
-
109
- $ rails generate acceptance_spec this_is_my_first_feature
110
-
111
- You run your acceptance specs just like your regular specs. Individually...
112
-
113
- $ spec spec/acceptance/this_is_my_first_feature_spec.rb
114
-
115
- ...or all together:
116
-
117
- $ spec spec/acceptance
118
-
119
- ...you can also do:
120
-
121
- $ rake spec:acceptance
122
-
123
- == Resources
124
-
125
- - Source: http://github.com/cavalle/steak
126
- - Issues: http://github.com/cavalle/steak/issues
127
- - Group: http://groups.google.com/group/steakrb
128
- - IRC channel: #steakrb on freenode
129
- - Tutorial: http://jeffkreeftmeijer.com/2010/steak-because-cucumber-is-for-vegetarians/
130
- - Hashtag: #steakrb
131
-
132
83
  == Credits
133
84
 
134
- Steak was created by Luismi Cavallé and improved thanks to the love from:
135
-
136
- - Álvaro Bautista
137
- - Felipe Talavera
138
- - Paco Guzmán
139
- - Jeff Kreeftmeijer
140
- - Jaime Iniesta
141
- - Emili Parreño
142
- - Andreas Wolff
85
+ Steak is developed and maintained by Luismi Cavallé with the help and support of the rest of the BeBanjo team: Sergio Gil and Jorge Gómez Sancha.
143
86
 
144
- Copyright (c) 2009, 2010 Luismi Cavallé, released under the MIT license
87
+ Copyright (c) 2009 Luismi Cavallé, released under the MIT license
@@ -0,0 +1,13 @@
1
+ require 'rails/generators'
2
+
3
+ class AcceptanceSpecGenerator < Rails::Generators::NamedBase
4
+ def manifest
5
+ empty_directory File.join('spec/acceptance', class_path)
6
+ file_name.gsub!(/_spec$/,"")
7
+ template 'acceptance_spec.rb', File.join('spec/acceptance', class_path, "#{file_name}_spec.rb")
8
+ end
9
+
10
+ def self.source_root
11
+ File.join(File.dirname(__FILE__), 'templates')
12
+ end
13
+ end
@@ -2,7 +2,7 @@ Description:
2
2
  Sets up Steak in your Rails project. This will generate the spec/acceptance directory
3
3
  and the necessary files.
4
4
 
5
- If you haven't already, You should also run `./script/generate rspec` to complete the set up.
5
+ If you haven't already, You should also run `rails generate rspec:install` to complete the set up.
6
6
 
7
7
  Examples:
8
- `./script/generate steak`
8
+ `rails generate steak`
@@ -0,0 +1,17 @@
1
+ require 'rails/generators'
2
+
3
+ class SteakGenerator < Rails::Generators::Base
4
+ def manifest
5
+ empty_directory 'spec/controllers'
6
+ empty_directory 'spec/acceptance/support'
7
+ empty_directory 'lib/tasks'
8
+ copy_file "acceptance_helper.rb", "spec/acceptance/acceptance_helper.rb"
9
+ copy_file "helpers.rb", "spec/acceptance/support/helpers.rb"
10
+ copy_file "paths.rb", "spec/acceptance/support/paths.rb"
11
+ copy_file "steak.rake", "lib/tasks/steak.rake"
12
+ end
13
+
14
+ def self.source_root
15
+ File.join(File.dirname(__FILE__), 'templates')
16
+ end
17
+ end
@@ -1,18 +1,10 @@
1
1
  require File.dirname(__FILE__) + "/../spec_helper"
2
2
  require "steak"
3
- <%- if options[:driver] == 'webrat' %>
4
3
  require "webrat"
5
4
 
6
5
  Webrat.configure do |config|
7
6
  config.mode = :rails
8
7
  end
9
- <%- else -%>
10
- require 'capybara/rails'
11
-
12
- Spec::Runner.configure do |config|
13
- config.include Capybara
14
- end
15
- <%- end -%>
16
8
 
17
9
  # Put your acceptance spec helpers inside /spec/acceptance/support
18
10
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
@@ -3,4 +3,4 @@ module HelperMethods
3
3
 
4
4
  end
5
5
 
6
- Spec::Runner.configuration.include(HelperMethods)
6
+ Rspec::Core.configuration.include(HelperMethods)
@@ -6,4 +6,4 @@ module NavigationHelpers
6
6
  end
7
7
  end
8
8
 
9
- Spec::Runner.configuration.include(NavigationHelpers)
9
+ Rspec::Core.configuration.include(NavigationHelpers)
@@ -0,0 +1,8 @@
1
+ load File.dirname(__FILE__) + '/rspec.rake'
2
+
3
+ namespace :spec do
4
+ desc "Run the code examples in spec/acceptance"
5
+ Rspec::Core::RakeTask.new(:acceptance => "db:test:prepare") do |t|
6
+ t.pattern = "spec/acceptance/**/*_spec.rb"
7
+ end
8
+ end
@@ -1,27 +1,31 @@
1
1
  require 'rubygems'
2
- require 'spec'
2
+ require 'rspec'
3
3
 
4
- module Spec::Example::ExampleGroupMethods
5
- alias scenario example
6
- alias background before
4
+ class Rspec::Core::ExampleGroup
5
+ class << self
6
+ alias scenario example
7
+ alias background before
8
+ end
7
9
  end
8
10
 
9
- module Spec::DSL::Main
11
+ module Rspec::Core::KernelExtensions
10
12
  alias feature describe
11
13
  end
12
14
 
13
- if defined?(Spec::Rails)
14
-
15
- module Spec::Rails::Example
16
- class AcceptanceExampleGroup < IntegrationExampleGroup
17
- include ActionController::RecordIdentifier
18
- Spec::Example::ExampleGroupFactory.register(:acceptance, self)
15
+ if defined?(Rspec::Rails)
19
16
 
17
+ module Rspec::Rails::Example
18
+ module AcceptanceExampleGroup
20
19
  def method_missing(sym, *args, &block)
21
- return Spec::Matchers::Be.new(sym, *args) if sym.to_s =~ /^be_/
22
- return Spec::Matchers::Has.new(sym, *args) if sym.to_s =~ /^have_/
20
+ return Rspec::Matchers::Be.new(sym, *args) if sym.to_s =~ /^be_/
21
+ return Rspec::Matchers::Has.new(sym, *args) if sym.to_s =~ /^have_/
23
22
  super
24
23
  end
24
+
25
+ Rspec.configure do |c|
26
+ c.include RequestExampleGroupBehaviour, :example_group => { :file_path => /\bspec\/acceptance\// }
27
+ c.include self, :example_group => { :file_path => /\bspec\/acceptance\// }
28
+ end
25
29
  end
26
30
  end
27
31
 
@@ -1,5 +1,5 @@
1
1
  require 'rubygems'
2
- require 'spec'
2
+ require 'rspec'
3
3
  require File.dirname(__FILE__) + "/../../lib/steak"
4
4
  require 'tempfile'
5
5
 
@@ -14,22 +14,18 @@ module Factories
14
14
  end
15
15
 
16
16
  def create_rails_app(options = {})
17
- path = Dir.tmpdir + "rails_app_#{String.random}"
17
+ path = File.join(Dir.tmpdir, String.random, "rails_app")
18
18
  FileUtils.rm_rf path
19
19
  `rails #{path}`
20
- FileUtils.rm path + '/public/index.html'
21
- File.open(path + "/config/environments/test.rb", "a") do |file|
22
- file.write "\nconfig.gem 'rspec-rails', :lib => false\n"
20
+ File.open(File.join(path, "Gemfile"), "a") do |file|
21
+ file.write "\ngem 'rspec-rails', '>= 2.0.0.a9'\n"
23
22
  end
24
23
  FileUtils.cp_r File.dirname(__FILE__) + "/../../", path + "/vendor/plugins/steak"
25
24
 
26
- Dir.chdir path do
27
- `script/generate rspec`
28
- end
29
-
30
25
  unless options[:setup_steak] == false
31
26
  Dir.chdir path do
32
- `script/generate steak`
27
+ `rails generate rspec:install`
28
+ `rails generate steak`
33
29
  end
34
30
  end
35
31
 
@@ -39,17 +35,30 @@ module Factories
39
35
  end
40
36
 
41
37
  module HelperMethods
42
- def run_spec(file_path)
43
- `spec #{file_path} 2>&1`
38
+ def run_spec(file_path, app_base=nil)
39
+ if app_base
40
+ current_dir = Dir.pwd
41
+ Dir.chdir app_base
42
+ end
43
+
44
+ output = `rspec #{file_path} 2>&1`
45
+
46
+ Dir.chdir current_dir if app_base
47
+ output
44
48
  end
45
49
  end
46
50
 
47
51
  class String
48
- CHARS = ('a'..'z').to_a + ('A'..'Z').to_a
52
+ unless const_defined?("CHARS")
53
+ CHARS = ('a'..'z').to_a + ('A'..'Z').to_a
54
+ end
55
+
49
56
  def self.random(size = 8)
50
57
  (0..size).map{ CHARS[rand(CHARS.length)] }.join
51
58
  end
52
59
  end
53
60
 
54
- Spec::Runner.configuration.include(Factories)
55
- Spec::Runner.configuration.include(HelperMethods)
61
+ Rspec.configure do |config|
62
+ config.include(Factories)
63
+ config.include(HelperMethods)
64
+ end
@@ -12,7 +12,7 @@ feature "Acceptance spec generator for rails", %q{
12
12
 
13
13
  scenario "Adding new acceptance spec" do
14
14
  Dir.chdir @rails_app do
15
- `script/generate acceptance_spec document_creation`
15
+ `rails generate acceptance_spec document_creation`
16
16
  end
17
17
 
18
18
  File.exist?(@rails_app + "/spec/acceptance/document_creation_spec.rb").should be_true
@@ -20,7 +20,7 @@ feature "Acceptance spec generator for rails", %q{
20
20
 
21
21
  scenario "Adding new acceptance spec (plural name)" do
22
22
  Dir.chdir @rails_app do
23
- `script/generate acceptance_spec creating_documents`
23
+ `rails generate acceptance_spec creating_documents`
24
24
  end
25
25
 
26
26
  File.exist?(@rails_app + "/spec/acceptance/creating_documents_spec.rb").should be_true
@@ -28,7 +28,7 @@ feature "Acceptance spec generator for rails", %q{
28
28
 
29
29
  scenario "Adding new acceptance spec (pascalized name)" do
30
30
  Dir.chdir @rails_app do
31
- `script/generate acceptance_spec DocumentCreation`
31
+ `rails generate acceptance_spec DocumentCreation`
32
32
  end
33
33
 
34
34
  File.exist?(@rails_app + "/spec/acceptance/document_creation_spec.rb").should be_true
@@ -36,7 +36,7 @@ feature "Acceptance spec generator for rails", %q{
36
36
 
37
37
  scenario "Adding new acceptance spec (name ending with _spec)" do
38
38
  Dir.chdir @rails_app do
39
- `script/generate acceptance_spec document_creation_spec`
39
+ `rails generate acceptance_spec document_creation_spec`
40
40
  end
41
41
 
42
42
  File.exist?(@rails_app + "/spec/acceptance/document_creation_spec.rb").should be_true
@@ -8,7 +8,7 @@ feature "Acceptance spec execution", %q{
8
8
 
9
9
  scenario "Minimal acceptance spec" do
10
10
  spec_file = create_spec <<-SPEC
11
- require '#{File.dirname(__FILE__) + "/../../lib/steak"}'
11
+ require '#{File.dirname(__FILE__) + "/../../lib/steak"}'
12
12
  feature "Minimal spec" do
13
13
  scenario "First scenario" do
14
14
  true.should be_true
@@ -13,11 +13,12 @@ feature "Acceptance spec execution", %q{
13
13
  require File.dirname(__FILE__) + "/acceptance_helper.rb"
14
14
  feature "Minimal spec" do
15
15
  scenario "First scenario" do
16
- Rails.env.should be_test
16
+ # Rails.env.should_not be_nil
17
+ Rails.env.should == "test"
17
18
  end
18
19
  end
19
20
  SPEC
20
- output = run_spec spec_file
21
+ output = run_spec spec_file, File.join(File.dirname(spec_file), '../..')
21
22
  output.should =~ /1 example, 0 failures/
22
23
  end
23
24
 
@@ -29,11 +30,11 @@ feature "Acceptance spec execution", %q{
29
30
  feature "Minimal spec" do
30
31
  scenario "First scenario" do
31
32
  get "/"
32
- response.should have_text(/No route matches/)
33
+ response.should contain(/Welcome aboard/)
33
34
  end
34
35
  end
35
36
  SPEC
36
- output = run_spec spec_file
37
+ output = run_spec spec_file, File.join(File.dirname(spec_file), '../..')
37
38
  output.should =~ /1 example, 0 failures/
38
39
  end
39
40
 
@@ -5,92 +5,20 @@ feature "Steak generator for rails", %q{
5
5
  As a developer
6
6
  I want to run a generator that sets everything up for me
7
7
  } do
8
-
8
+
9
9
  scenario "Running generator in an empty project" do
10
+
10
11
  rails_app = create_rails_app(:setup_steak => false)
11
-
12
+
12
13
  Dir.chdir rails_app do
13
- `script/generate steak`
14
+ `rails generate steak`
14
15
  end
15
-
16
+
16
17
  File.exist?(rails_app + "/spec/acceptance/acceptance_helper.rb").should be_true
17
18
  File.exist?(rails_app + "/spec/acceptance/support/helpers.rb").should be_true
18
19
  File.exist?(rails_app + "/spec/acceptance/support/paths.rb").should be_true
19
20
  File.exist?(rails_app + "/lib/tasks/steak.rake").should be_true
20
- end
21
-
22
- scenario "Running generator with capybara by default" do
23
- rails_app = create_rails_app(:setup_steak => false)
24
-
25
- Dir.chdir rails_app do
26
- `script/generate steak`
27
- end
28
-
29
- spec_file = create_spec :path => rails_app + "/spec/acceptance",
30
- :content => <<-SPEC
31
- require File.dirname(__FILE__) + "/acceptance_helper.rb"
32
- feature "Capybara spec" do
33
- scenario "First scenario" do
34
- visit "/"
35
- page.should have_content('No route matches')
36
- end
37
- end
38
- SPEC
39
- output = run_spec spec_file
40
- output.should =~ /1 example, 0 failures/
41
- end
42
-
43
- scenario "Running generator with webrat" do
44
- rails_app = create_rails_app(:setup_steak => false)
45
-
46
- Dir.chdir rails_app do
47
- `script/generate steak --webrat`
48
- end
49
-
50
- spec_file = create_spec :path => rails_app + "/spec/acceptance",
51
- :content => <<-SPEC
52
- require File.dirname(__FILE__) + "/acceptance_helper.rb"
53
- feature "Capybara spec" do
54
- scenario "First scenario" do
55
- visit "/"
56
- response.should contain('No route matches')
57
- end
58
- end
59
- SPEC
60
- output = run_spec spec_file
61
- output.should =~ /1 example, 0 failures/
62
- end
63
-
64
- scenario "Running rake stats" do
65
- rails_app = create_rails_app
66
-
67
- Dir.chdir rails_app do
68
- `script/generate steak`
69
- `rake stats`.should =~ /Acceptance specs/
70
- end
21
+
71
22
  end
72
23
 
73
- scenario "Running specs with rake" do
74
- rails_app = create_rails_app(:setup_steak => true)
75
-
76
- spec_file = create_spec :path => rails_app + "/spec/acceptance",
77
- :content => <<-SPEC
78
- require File.dirname(__FILE__) + "/acceptance_helper.rb"
79
- feature "Basic spec" do
80
- scenario "First scenario" do
81
- true.should == true
82
- end
83
- end
84
- SPEC
85
-
86
- Dir.chdir rails_app do
87
- `rake db:create db:migrate db:test:prepare`
88
-
89
- output = `rake spec:acceptance`
90
- output.should =~ /1 example, 0 failures/
91
-
92
- output = `rake`
93
- output.should =~ /1 example, 0 failures/
94
- end
95
- end
96
- end
24
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steak
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
5
- prerelease: false
4
+ prerelease: true
6
5
  segments:
7
6
  - 0
8
- - 3
9
- - 8
10
- version: 0.3.8
7
+ - 4
8
+ - 0
9
+ - a1
10
+ version: 0.4.0.a1
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Luismi Cavall\xC3\xA9"
@@ -15,86 +15,76 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-31 00:00:00 +02:00
18
+ date: 2010-03-07 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rspec
23
23
  prerelease: false
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
- none: false
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 27
30
28
  segments:
31
- - 1
32
- - 3
33
29
  - 0
34
- version: 1.3.0
30
+ version: "0"
35
31
  type: :runtime
36
32
  version_requirements: *id001
37
- description: If you are not in Rails but use Rspec, then Steak is just some aliases providing you with the language of acceptance testing (feature, scenario, background). If you are in Rails, you also have a couple of generators, a rake task and full Rails integration testing (meaning Webrat support, for instance)
33
+ description: Minimalist acceptance testing on top of RSpec
38
34
  email: luismi@lmcavalle.com
39
35
  executables: []
40
36
 
41
37
  extensions: []
42
38
 
43
- extra_rdoc_files: []
44
-
39
+ extra_rdoc_files:
40
+ - README.rdoc
45
41
  files:
46
- - init.rb
47
- - MIT-LICENSE
48
- - Rakefile
49
42
  - README.rdoc
43
+ - lib/generators/acceptance_spec/USAGE
44
+ - lib/generators/acceptance_spec/acceptance_spec_generator.rb
45
+ - lib/generators/acceptance_spec/templates/acceptance_spec.rb
46
+ - lib/generators/steak/USAGE
47
+ - lib/generators/steak/steak_generator.rb
48
+ - lib/generators/steak/templates/acceptance_helper.rb
49
+ - lib/generators/steak/templates/helpers.rb
50
+ - lib/generators/steak/templates/paths.rb
51
+ - lib/generators/steak/templates/steak.rake
50
52
  - lib/steak.rb
51
- - generators/acceptance_spec/acceptance_spec_generator.rb
52
- - generators/acceptance_spec/templates/acceptance_spec.rb
53
- - generators/acceptance_spec/USAGE
54
- - generators/steak/steak_generator.rb
55
- - generators/steak/templates/acceptance_helper.rb
56
- - generators/steak/templates/helpers.rb
57
- - generators/steak/templates/paths.rb
58
- - generators/steak/templates/steak.rake
59
- - generators/steak/USAGE
60
- - spec/acceptance/acceptance_helper.rb
61
- - spec/acceptance/acceptance_spec_generator_spec.rb
62
- - spec/acceptance/basic_spec.rb
63
- - spec/acceptance/rails_spec.rb
64
- - spec/acceptance/steak_generator_spec.rb
65
53
  has_rdoc: true
66
54
  homepage: http://github.com/cavalle/steak
67
55
  licenses: []
68
56
 
69
57
  post_install_message:
70
- rdoc_options: []
71
-
58
+ rdoc_options:
59
+ - --charset=UTF-8
72
60
  require_paths:
73
61
  - lib
74
62
  required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
63
  requirements:
77
64
  - - ">="
78
65
  - !ruby/object:Gem::Version
79
- hash: 3
80
66
  segments:
81
67
  - 0
82
68
  version: "0"
83
69
  required_rubygems_version: !ruby/object:Gem::Requirement
84
- none: false
85
70
  requirements:
86
- - - ">="
71
+ - - ">"
87
72
  - !ruby/object:Gem::Version
88
- hash: 3
89
73
  segments:
90
- - 0
91
- version: "0"
74
+ - 1
75
+ - 3
76
+ - 1
77
+ version: 1.3.1
92
78
  requirements: []
93
79
 
94
80
  rubyforge_project:
95
- rubygems_version: 1.3.7
81
+ rubygems_version: 1.3.6
96
82
  signing_key:
97
83
  specification_version: 3
98
- summary: Minimalist acceptance testing on top of Rspec
99
- test_files: []
100
-
84
+ summary: If you are not in Rails but use RSpec, then Steak is just some aliases providing you with the language of acceptance testing (feature, scenario, background). If you are in Rails, you also have a couple of generators, a rake task and full Rails integration testing (meaning Webrat support, for instance)
85
+ test_files:
86
+ - spec/acceptance/acceptance_helper.rb
87
+ - spec/acceptance/acceptance_spec_generator_spec.rb
88
+ - spec/acceptance/basic_spec.rb
89
+ - spec/acceptance/rails_spec.rb
90
+ - spec/acceptance/steak_generator_spec.rb
@@ -1,20 +0,0 @@
1
- Copyright (c) 2009 Luismi Cavallé
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile DELETED
@@ -1,24 +0,0 @@
1
- require "rubygems"
2
- require "rake/gempackagetask"
3
- require "rake/rdoctask"
4
-
5
- require "spec"
6
- require "spec/rake/spectask"
7
- Spec::Rake::SpecTask.new do |t|
8
- t.spec_opts = %w(--format specdoc --colour)
9
- t.libs = ["spec"]
10
- end
11
-
12
- task :default => ["spec"]
13
-
14
- # Generate documentation
15
- Rake::RDocTask.new do |rd|
16
- rd.main = "README.rdoc"
17
- rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
18
- rd.rdoc_dir = "rdoc"
19
- end
20
-
21
- desc 'Clear out RDoc and generated packages'
22
- task :clean => [:clobber_rdoc, :clobber_package] do
23
- rm "#{spec.name}.gemspec"
24
- end
@@ -1,9 +0,0 @@
1
- class AcceptanceSpecGenerator < Rails::Generator::NamedBase
2
- def manifest
3
- record do |m|
4
- m.directory File.join('spec/acceptance', class_path)
5
- file_name.gsub!(/_spec$/,"")
6
- m.template 'acceptance_spec.rb', File.join('spec/acceptance', class_path, "#{file_name}_spec.rb")
7
- end
8
- end
9
- end
@@ -1,26 +0,0 @@
1
- class SteakGenerator < Rails::Generator::Base
2
- default_options :driver => 'capybara'
3
-
4
- def initialize(runtime_args, runtime_options = {})
5
- puts "Defaulting to Capybara..." if runtime_args.empty?
6
- super
7
- end
8
-
9
- def manifest
10
- record do |m|
11
- m.directory 'spec/acceptance/support'
12
- m.directory 'lib/tasks'
13
- m.template "acceptance_helper.rb", "spec/acceptance/acceptance_helper.rb"
14
- m.file "helpers.rb", "spec/acceptance/support/helpers.rb"
15
- m.file "paths.rb", "spec/acceptance/support/paths.rb"
16
- m.file "steak.rake", "lib/tasks/steak.rake"
17
- end
18
- end
19
-
20
- def add_options!(opt)
21
- opt.separator ''
22
- opt.separator 'Options:'
23
- opt.on('--capybara', 'Use Capybara (default).') { |v| options[:driver] = 'capybara' }
24
- opt.on('--webrat', 'Use Webrat.') { |v| options[:driver] = 'webrat' }
25
- end
26
- end
@@ -1,20 +0,0 @@
1
- unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks
2
-
3
- require 'spec/rake/spectask'
4
-
5
- namespace :spec do
6
- desc "Run the code examples in spec/acceptance"
7
- Spec::Rake::SpecTask.new(:acceptance => "db:test:prepare") do |t|
8
- t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
9
- t.spec_files = FileList["spec/acceptance/**/*_spec.rb"]
10
- end
11
-
12
- # Setup stats to include acceptance specs
13
- task :statsetup do
14
- require 'code_statistics'
15
- ::STATS_DIRECTORIES << %w(Acceptance\ specs spec/acceptance) if File.exist?('spec/acceptance')
16
- ::CodeStatistics::TEST_TYPES << "Acceptance specs" if File.exist?('spec/acceptance')
17
- end
18
- end
19
-
20
- end
data/init.rb DELETED
@@ -1,8 +0,0 @@
1
- # Placeholder to satisfy Rails.
2
- #
3
- # Do NOT add any require statements to this file. Doing
4
- # so will cause Rails to load this plugin all of the time.
5
- #
6
- # spec/acceptance/acceptance_helper.rb should include the necessary
7
- # require statements and configuration. This file should
8
- # be required by all of your acceptance specs.